3

I have a mail server using maildir format, with about 100GB of data, and several directories have over 20000 files each. I'm currently using ext3, and I noticed that it's a bit slow sometimes. So I'd like to try a faster file system, but it needs to be stable and reliable.

Which one would you recommend?

aditsu
  • 386
  • 1
  • 4
  • 10
  • 2
    What testing have you done (if any) to verify that the filesystem itself is your bottleneck? – EEAA Oct 13 '10 at 18:45
  • I have to admit.. I haven't done any proper testing. Do you think it's likely not the filesystem? – aditsu Oct 13 '10 at 19:19
  • What makes you think that the filesystem is your bottleneck? "it's a bit slow sometimes" what exactly is slow? – Ben Quick Oct 14 '10 at 07:09
  • Opening a big folder in the email client takes a while, and rsync (for backing up maildirs to another machine) also takes its time checking which files are changed. It seems that I'm having some openvpn speed issues too. What do you recommend for testing the filesystem performance? – aditsu Oct 14 '10 at 07:22
  • Opening mail folders could be due to indexes for your mail(box|dir|client). As for performance testing, from http://www.google.co.uk/#sclient=psy&hl=en&q=filesystem+performance+test points to iozone http://www.cyberciti.biz/tips/linux-filesystem-benchmarking-with-iozone.html – Ben Quick Oct 14 '10 at 07:51

7 Answers7

4

ext3 can be tuned to better handle large directories

run this: tune2fs -O dir_index /dev/hdXY
then this: e2fsck -D -f /dev/hdXY

The first one enables it for all future directories. The second one crawls through all your existing directories and builds the hash trees. That may take a good long while, so plan for some downtime.

cagenut
  • 4,848
  • 2
  • 24
  • 29
3

I used XFS for a mail server setup (has been ext3 before) and definitely noticed an improvement with all the small files but it has been a while back and IIRC there are/were some "issues" with XFS and power-cuts (or any abrupt disruption to disk access for that matter) leaving all opened files filled with "0" and similar.

But as mention by others: testing is in order, the same FS can behave quite differently on different hardware and as I said in the beginning it has been a while since I setup that server.... (I guess about 4 years) and the available FS and also their performance might have changed quite a bit.

all in all this is just my 2¢

Marcel G
  • 2,269
  • 15
  • 24
  • +1 for mentioning testing. I also use XFS everywhere (many small files and some large files), and it comes out best on I/O testing every time. – pauska Oct 13 '10 at 21:11
  • +1 I've always seen performance benefits from XFS for mail servers too, and it's my general preference for them. – Twirrim Oct 14 '10 at 00:48
  • 1
    I've seen lots of contradicting opinions about XFS, ranging from "you WILL DEFINITELY LOSE DATA, and it's only good for large files" to "it's rock solid and optimized for many small files". I don't really know what to believe. Testing is desirable indeed, but it can take a lot of time to do it well. – aditsu Oct 21 '10 at 10:22
2

I agree with the above recommendations. Testing is very important.

Do also consider ReiserFS. One of its design goals was for efficient handling of large numbers of small (< 4KiB) files, which is what a typical maildir implementation has to deal with. Wikipedia has an informative article about it, highlighting both its pros and cons.

Steven Monday
  • 13,599
  • 4
  • 36
  • 45
  • This sounds like a job that would be best served with ReiserFS. There is always many ways to do something, some may yield better performance than others. XFS is a great general system FS, this just doesn't look like a general situation. – J. M. Becker Sep 21 '11 at 16:06
1

I would go with XFS. You may want to read this thread (It first appeared in comp.mail.imap and comp.os.linux.misc but cannot find it in Google Groups)

adamo
  • 6,925
  • 3
  • 30
  • 58
0

How about ext4?

Cypher
  • 1,077
  • 2
  • 17
  • 24
0

Compared to EXT3, EXT4's 'big directory' performance is much better. Several improvements were made to handle the case of "umpty thousand files in one directory". The biggest improvements are made in the 100K+/per-dir range, so you might not be see any significant improvement in switching with your loads (testing would be a good idea) .

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
0

In your situation consider XFS, since it is much faster than ext4.

Mail server (postfix, etc ...) flushes a file with fsync() to assure the file was indeed written. Count of writes and fsyncs per mail is at least two (without spam checkers and anti viruses), so you need a file system which performs best in this scenario.

The last time I was checking out tests and testing myself XFS still beat the crap out of the other competing file systems.

koo.
  • 1