David Lee
2006-Jul-19 14:49 UTC
[Dovecot] /var/spool/mail directory size and subdirectories
(Complete newbie to dovecot. I hope what follows isn't something I've missed in some FAQ somewhere...) On a traditional UNIX filesystem with UW-IMAP several years ago, we encountered major performance problems when "/var/spool/mail/" got big (we would currently be ~20,000 entries). This was due to the inefficiency of the UNIX filesystem when creating and deleting the lockfiles (etc.) in a directory of that size. We worked around that (all those years ago) with a local source-code mod to UW-IMAP ("c-client") to use subdirectories "/var/spool/mail/00/" to "/var/spool/mail/99/" based on a trivially simply "uid mod 100" algorithm. (Our uids are random; our usernames are not.) Thus we had 100 subdirs each of about 200 entires. Efficiency and performance vastly improved, and we've been running like that ever since. Now we are considering migrating to dovecot... Does dovecot do file creation/deletion in this (or similar shared) directory? (And so would it be liable to the same inefficiency problems?) Is there some means in the "dovecot.conf" file to specify an INBOX pattern as "/var/spool/mail/%ZZZ%/%u" where "%ZZZ%" could be algorithmically specified as (say) "user-uid mod 100"? -- : David Lee I.T. Service : : Senior Systems Programmer Computer Centre : : Durham University : : http://www.dur.ac.uk/t.d.lee/ South Road : : Durham DH1 3LE : : Phone: +44 191 334 2752 U.K. :
seth vidal
2006-Jul-19 14:54 UTC
[Dovecot] /var/spool/mail directory size and subdirectories
On Wed, 2006-07-19 at 15:49 +0100, David Lee wrote:> (Complete newbie to dovecot. I hope what follows isn't something I've > missed in some FAQ somewhere...) > > On a traditional UNIX filesystem with UW-IMAP several years ago, we > encountered major performance problems when "/var/spool/mail/" got big (we > would currently be ~20,000 entries). This was due to the inefficiency of > the UNIX filesystem when creating and deleting the lockfiles (etc.) in a > directory of that size. > > We worked around that (all those years ago) with a local source-code mod > to UW-IMAP ("c-client") to use subdirectories "/var/spool/mail/00/" to > "/var/spool/mail/99/" based on a trivially simply "uid mod 100" algorithm. > (Our uids are random; our usernames are not.) Thus we had 100 subdirs > each of about 200 entires. Efficiency and performance vastly improved, > and we've been running like that ever since. > > Now we are considering migrating to dovecot... > > Does dovecot do file creation/deletion in this (or similar shared) > directory? (And so would it be liable to the same inefficiency problems?) > > Is there some means in the "dovecot.conf" file to specify an INBOX pattern > as "/var/spool/mail/%ZZZ%/%u" where "%ZZZ%" could be algorithmically > specified as (say) "user-uid mod 100"?look in variables.txt that comes in the tarball. I think the %H will have some of what you're looking for - or segments of the %u -sv
Johannes Berg
2006-Jul-19 15:28 UTC
[Dovecot] /var/spool/mail directory size and subdirectories
On Wed, 2006-07-19 at 15:49 +0100, David Lee wrote:> Is there some means in the "dovecot.conf" file to specify an INBOX pattern > as "/var/spool/mail/%ZZZ%/%u" where "%ZZZ%" could be algorithmically > specified as (say) "user-uid mod 100"?If all your uids are a fixed number of digits you could do default_mail_env = /var/spool/mail/%3.2i/%u (if all uids are 5 digits long) The closest other scheme based on UIDs I can think of is %.2Ri, which gives you the last two digits of the UID (i.e. uid mod 100) but in reverse, so for uid 1234 it'd give you 43. Depending on what other tools you use, you could also use the hash (H) modifier, but maybe your delivery agent can't do that (unless of course you plan to use dovecot-lda too) Hope that helps, johannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 828 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20060719/5510b295/attachment.bin>
Frank Cusack
2006-Jul-19 15:36 UTC
[Dovecot] /var/spool/mail directory size and subdirectories
On July 19, 2006 3:49:17 PM +0100 David Lee <t.d.lee at durham.ac.uk> wrote:> to UW-IMAP ("c-client") to use subdirectories "/var/spool/mail/00/" to > "/var/spool/mail/99/" based on a trivially simply "uid mod 100" algorithm. > (Our uids are random; our usernames are not.) Thus we had 100 subdirs > each of about 200 entires. Efficiency and performance vastly improved, > and we've been running like that ever since. > > Now we are considering migrating to dovecot... > > Does dovecot do file creation/deletion in this (or similar shared) > directory? (And so would it be liable to the same inefficiency problems?)If you are migrating, why not change to maildir in $HOME? -frank