Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20030228231235.GA22443@openwall.com>
Date: Sat, 1 Mar 2003 02:12:35 +0300
From: Solar Designer <solar@...nwall.com>
To: popa3d-users@...ts.openwall.com
Subject: mbox vs. Maildir (Re: Mailbox Size Limit)

Hi,

If anyone wants my opinion, here it is.

The choice of mbox vs. Maildir is really not so obvious.

Yes, mbox requires compatible locking across mail software on the
system and doesn't guarantee reliability over system crashes (while
no mail loss should occur, it is possible that the file's format would
be violated and require manual correction).  Unless caching is used,
it also requires reading in the entire mailbox contents on each POP3
session.

However, Maildirs have a higher filesystem load: more inodes used,
more disk space used (each message occupies a whole number of disk
blocks, so, with many filesystems, you waste 1 fs block per 2
messages), longer fsck runs (when applicable), system crashes more
likely result in fs errors that fsck won't dare to repair
automagically, more disk seeks are required to fetch an entire mailbox
(and a significant number of POP3 clients are set to retrieve and
delete all messages).  Speaking of disk seeks, they and not the disk
transfer rate are very often the limiting factor on busy servers.

Of course, all of this is only a problem with a large number of users,
but why care about performance so much if you only serve a hundred
user accounts?  (And we serve about 10k users with mbox format on
Linux with ext2fs just fine.  512 MB memory, 20 MB mailbox quotas.  If
we blindly switched to Maildir without also moving away from ext2fs,
I would expect the problems I've mentioned above.)

I personally would go for mbox + caching of message info, although in
practice mbox + caching of file content by the kernel is usually
sufficient.  As I have mentioned, Linux is especially good at that.
When the contents of an mbox are cached by the kernel, it doesn't take
long for popa3d to open a session to it:

Mar  1 01:58:00 david popa3d[22544]: Authentication passed for solar
Mar  1 01:58:01 david popa3d[22544]: 33093 messages (183323714 bytes) loaded

As you can see, it's about 1 second to parse a 180 MB mbox on my home
workstation.  (No, it's not my current mailbox, -- I've moved back
some of my old mail for this benchmark.)

The popa3d Maildir support patches are still unofficial.  They work,
but aren't tested as well as the mbox code is.

On Fri, Feb 28, 2003 at 12:17:23PM +0100, Jakob Hirsch wrote:
> > ....This is what I've read about the shortcomings of the mbox
> > format....
> 
> and it's all true. additionally, a pop3-server has to read the complete
> mailbox-file when the user is logging in, so some clients may experience
> timeouts if your machine is slow or has high load. Some use a sort of
> caching, but that solves the problem only partly.
> 
> > But, why should -i- have to change this?
> 
> Because -you- want the improvements.
> 
> > (And, if you don't mind me asking, how do).
> 
> Depends on the software you use.
> With sendmail, I think you have to read the procmail manpage.
> With Exim (and postfix AFAIK) it's just a config option.
> 
> With popa3d there is a patch for 0.5.9.
> 
> > Why isn't it used by default?
> 
> Why is sendmail used by default? Why bind? Why UW-IMAP or qpopper?
> People tend to use what everybode else uses and what they used before.
> 
> 
> Bye, Jakob

-- 
/sd

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.