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.
find /path/to/folder -mtime +100