I’ve just moved all my sites on to a new install of Ubuntu on one of my VPses. This site and In Photos are now on the same server again and the VPS has finally calmed down.
Between configuring Apache (turn off keep alives, and reduce the number of child processes), installing xcache and the WordPress object cache and configuring it, and configuring MySQL I totally forgot about Postfix.
I did install Postgrey of course but when Blacknight switched the ocaoimh.ie web and mail traffic to this server things started to go screwy.
Load average shot up, I thought it was Apache and spent quite some time playing with the number of processes, all to no avail. I didn’t immediately notice the large number of smtp processes when I did a “ps auxw”. I was looking at Apache.
What was happening was a rumplestiltskin attack on my server. Rogue bots all over the Internet try to send spam emails to mail servers using randomly generated addresses in the hope of guessing a correct one. It happens all the time, and I had configured Postfix correctly in the past, but I had forgot this time.
So, if your server is suffering under the strain of too many Postfix smtp processes open up /etc/postfix/master.cf and look for the smtp line:
smtp inet n – – – – smtpd
Change the last dash to a number, try small first, depending on how much mail traffic your server gets. I changed mine to 3, restarted Postfix, and the server is humming along nicely now. Postfix was actually using up more resources than Apache during those attacks! It’s unfortunate that Ubuntu (and probably every other dist of Linux) allows unlimited number of smtp processes.
Oh, I’m hosted at Linode. Yes that’s an affiliate link, but I’ve been using them for years and been very happy with them.