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.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/ .
© Major Hayden 2010.

4 Comments   »

  • caleb says:

    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.

  • major says:

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

  • breun says:

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

  • argonius says:

    @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 )

RSS feed for comments on this post , TrackBack URI

Leave a Reply