Reduce iowait in Plesk: put qmail’s queue on a ramdisk

I really dislike qmail. But, since I use Plesk, I’m stuck with it. However, I found a way to improve it’s awful mail queue performance by putting the mail queue onto a ramdisk. This is actually pretty darned easy to do.

First, toss a line like this into your /etc/fstab:

none    /mailqueue      tmpfs   defaults,size=100m,nr_inodes=999k,mode=775      0       0

This will make a 100MB ramdisk on /mailqueue. Now, just symlink /var/qmail/mqueue to /mailqueue and move your e-mail over:

# mount /mailqueue
# chmod 750 /mailqueue
# chown qmailq:qmail /mailqueue
# mv /var/qmail/mqueue /var/qmail/mqueue-old
# ln -s /mailqueue /var/qmail/mqueue
# rsync -av /var/qmail/mqueue-old /mailqueue

This has significantly cut the iowait on my server during heavy e-mail periods. In addition, tools like qmHandle now fly through my mail queue and give me reports very quickly.

4 Responses

  1. The downside to using tmpfs (http://en.wikipedia.org/wiki/TMPFS) is that all messages in your queue will be lost if the server is rebooted.

  2. At least you get the benefit of removing all of the spam e-mails being sent from compromised user accounts. :-)

  3. Did you try increasing some of qmail’s concurrency settings? Worked for me.

  4. @breun:
    To which value do you increased your concurrency settings? I use 50 for local and remote.

    @rackerhacker:
    Do you realy using the original qmHandle on Plesksystem?? You should better use mailqueuemng ( qmHandle stolen by parallels :p )

Leave a Reply