Q: Mailbox format

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 22 14:44:02 UTC 2004


On Wed, Apr 21, 2004 at 10:58:33PM -0400, S P Arif Sahari Wibowo wrote:
> Few months ago in one TLUG meeting we talked about IMAP server & the
> mailbox format it used. Part of it was about how maildir format is much 
> better than single file as a mailbox.
> 
> Well, in 1999 Mark Crispin wrote an article about mailbox format, and he 
> wrote why maildir (file per message) format is not a good idea. Is his 
> reasoning not correct or not applicable anymore?
> 
> http://www.washington.edu/imap/documentation/formats.txt.html
>  ...
> 
> There's a general reason why file/message formats are a bad idea. Just
> about every filesystem in existance serializes file creation and deletions
> because these manipulate the free space map.  This turns out to be an
> enormous problem when you start creating/deleting more than a few messages
> per second; you spend all your time thrashing in the filesystem.
>  
> It is also extremely slow to do a text search through a file/message
> format mailbox.  All of those open()s and close()s really add up to major
> filesystem thrashing.

Deleting a single message in mailbox format takes longer than maildir
usually, since you have to rewrite at least part of a large file, vs
just unlinking a file.

If you have email with large attachments, it is much faster to open and
read a the header of each file than it is to read past each attachment.

If you have mainly small emails, then mailbox format is faster due to
open/close overhead.  It's a tradeoff really.  Perhaps a better format
would be some kind of database which can have just one large file, but
have the indexing to help it jump to headers and such.  Could even make
searching faster by indexing each header field and such.  no such
standard of course at the moment.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list