[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ext2/3 vs xfs for maildir

On Fri, Jan 01, 2010 at 09:51:23AM -0600, Stan Hoeppner wrote:

> Which filesystem is more appropriate for maildir use on a
> Postfix/Dovecot system, ext2/3 or xfs?  This maildir will be storing
> mulitple mail folders and files, some folders containing over 10,000
> email files.

I'd recommend XFS for two main reasons:

    1. XFS does dynamic inode allocation, so you aren't wasting space
       for inodes you aren't using. You can tweak the number of inodes
       with ext, of course, but only at format time.

    2. XFS handles large directories better, although setting dir_index
       might speed up your ext3 directory access quite a lot.

Of course, XFS doesn't support full journaling, but you probably don't
want that with such high mail volumes anyway. The maildir format is
supposed to be atomic, but it's really up to the MTA/MDA to report
successful delivery only after the file has been successfully written to
disk, and may not work properly on NFS or other filesystems that don't
support the proper semantics.

The whole point of maildir, though, is to treat each email as an
individual file, so this limits your damage even if you pull the plug in
the middle of a write operation. That doesn't mean you can't lose data,
but it sure is a lot harder to have a catastrophic failure that way.

Maildir uses a lot of inodes, though, and this used to be a big issue
for me back in the day when running qmail on ext2, because I had to
configure the filesystem so it wouldn't run out of inodes before it ran
out of disk space. These days, I think XFS is going to be more
efficient, but with a big enough hard drive it probably won't matter
enough to lose sleep over.

> If xfs, what is the most appropriate mkfs.xfs command line for

Unlike ext2/3, I find that the defaults for XFS work just fine. I
typically add "relatime,barrier,logbufs=8" to the mount options, but I
just use the default formatting options. This is definitely a YMMV
situation, though.

"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"

Reply to: