Subject: | [patch] Use a hierarchy in FileSystem storage |
Date: | Tue, 29 Jun 2010 15:15:39 +0200 |
To: | bug-POE-Component-MessageQueue [...] rt.cpan.org |
From: | Sébastien Aperghis-Tramoni <saper [...] cpan.org> |
Hello,
We are using PoCo MQ at work and are regularly facing a problem with
how it stores the messages body on the filesystem: if the consumer
stops fetching messages for whatever reason (like a crash), the messages
piles up, saturating the number of inodes in the storage directory.
This makes PoCo MQ dies with a "no space left on device" error (in fact
a "no inodes available", but it's the same errno).
The attached patch implements a strategy similar to the one used in CPAN
or in software with a similar problematic, by storing the messages in a
hierarchy, in order to limit the number of consumed inodes per directory.
For example msg-5ec41b0b-1fad-4ad6-a05e-c0f66aa27425.txt is now stored in
$data_dir/5/5e/msg-5ec41b0b-1fad-4ad6-a05e-c0f66aa27425.txt
The hierarchy depth can be controlled with the data_dir_depth attribute,
which defaults to 2.
The patch also adjusts the corresponding tests.
--
Sébastien Aperghis-Tramoni
Close the world, txEn eht nepO.
Message body is not shown because sender requested not to inline it.