[Dovecot] Speed up large maildirs

John Peacock jpeacock at rowman.com
Tue Feb 15 20:49:03 EET 2005


Leen Besselink wrote:
> If someone would make a wrapper-program around the delivery-program (like qmail-local,
> vpopmaildeliver, procmail or local and virtual from postfix) and the delivery program would
> print to standard output the path+filename it saved a (or more) message(s) to, the wrapper
> would be able to send an update-message to a dovecot-daemon.

I don't understand how this would be an improvement.  Currently, when 
dovecot opens a "folder" the first thing it does is open folder/new and 
moves those files to folder/cur, presumably updating the index as it 
goes.  That is as fast as it could ever get.

Perhaps a short description of how Maildirs work (as I understand it) is 
in order:

1) an external application creates a files in ./tmp (this is the one 
time-consuming operation and it is not guaranteed to be atomic);

2) the same application then renames that file into the ./new folder 
(this is atomic);

3) another application (say dovecot) opens the Maildir for reading and 
moves any files from ./new to ./cur (since this neatly corresponds to 
"new" files as opposed to previously seen files).

How would some additional information to the dovecot-daemon help in any 
way?  The files in ./new are guaranteed to be, well, NEW, so they are 
the ones that dovecot needs to add to its own index, to avoid having to 
open the ./cur folder and enumerate all files every single time.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748


More information about the dovecot mailing list