On Mon, Sep 01, 2003 at 07:39:25PM -0400, Ken Weingold wrote: > I converted to maildir. Is it just me or do maildir mailboxes take up > a lot more disk space than mbox? And the mailboxes seem to take > longer to open, at least with over 1000 messages. Yes. Both problems are caused by the fact that each message is in one file. The size is inflated substantially because with most filesystems (ReiserFS being the only exception I can think of), each file uses disk space in chunks equal to the block size. So if your block size is 4k, then each message will use at least 4k, even if it is only say 800 bytes. That's a pretty substantial waste of disk space. ReiserFS will help out there, as it allows you to use fragments of blocks for individual files. But I've heard that ReiserFS is slow for some common operations, so this may not help with the next issue. On other filesystems, your average disk waste will be about half a block per message... not an insubstantial amount. The speed is reduced because there is substantial overhead involved with opening a file, and with a large number of messages in a maildir mail folder, you have that many files to open. It is much less efficient to open multiple files, probably doing a disk seek in between each one, than it is to simply open a file and read to the end of it (as in the case of mbox), even taking into account disk fragmentation. As someone else commented, this problem is exascerbated by the way many Unix-based filesystems handle many files in a given directory. But the problem is inherent to maildir, regardless of the file system used -- it is only that much slower on file systems which handle large numbers of files poorly. As yet another person pointed out, maildir works quite well for incoming mail spools, so long as you keep them relatively small. For archival purposes, mbox is generally better: you have not the problems with locking, since mail isn't delivered there, and opening large mbox mail folders is fast. The former assumes, of course, that you are moving messages into the archive folder manually, and no new messages get delivered to them by the MDA. If you are actually having mail delivered there, particularly over NFS, you could still have a problem. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail. Sorry for the inconvenience. Thank the spammers.
Attachment:
pgpSJ2lJI2r6Y.pgp
Description: PGP signature