Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Debian mail server running Postfix, Courier and Maildir, with disks on EXT3 filesystem.

I have noticed that when I use my webmail application (Squirrelmail, in this case). It gets some kind of slow when using some email accounts (I have various domains with each one having several email accounts in the same server).

So, monitoring to discover what is the botteneck that may be causing the slowness, I have noticed that my RAM and CPU are mostly free, what I identified was some processes eating high ammounts of disk I/O, the processes that are constantly consuming the disk I/O are:

kjournald

imapd Maildir

courierpop3d Maildir

pipe -n maildrop -t unix flags=R user=maildrop argv=/usr/bin/maildrop -d ${recipient}

I came into a conclusion that what is causing the slowness is the Maildir of some users that are too big (too much files in the cur and new directories) so, when an operation using the maildir is used, it eats insane ammounts of disk I/O.

And here's my question, is there a way to reduce the number of files in a Maildir? for example, there's an user cur folder with more than 80000 files, and everytime he gets to open his email client, the whole server becomes slow.

I don't know what is the recommended number of files in a directory, but if I could divide the 80000 files in various folders inside the cur directory (is it possible?) maybe the disk would get some rest.

Thank you.

share|improve this question
    
You could archive messages that are older than a number of days by moving them to another directory, using something like find /path/to/folder -mtime +100 –  LinuxDevOps Mar 21 at 14:20
    
I've tried that, but this generates in the Inbox folder being divided into several "archive" folders, isn't there a way to do it that is transparent to the user? (I don't know if you're fammiliar, but something like Zimbra does with its folders, it divides the messages into a lot of directories but the user only sees a single "inbox") –  gtbono Mar 21 at 14:58
    
Not sure I understand where the several archive folders come from, you can have one 'archive' folder per user, there are several scripts that can help you with the move, see for ex: ducea.com/2006/11/25/… –  LinuxDevOps Mar 21 at 15:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.