Performance Tuning WordPress for Low Spec Servers

I recently moved my website to a cheap VPS I had the fun journey of trying to get it work without grinding to a halt everytime I clicked on a page, which you ‘should’ have noticed is fixed.

Firstly I needed to be realistic this blog wouldn’t have more than two simultanious connections at once, with that known I could then edit the amount for apache server threads to an un-godly small number in /etc/apache2/apache2.conf


StartServers 2
MinSpareServers 2
MaxSpareServers 2
MaxClients 20
MaxRequestsPerChild 0

With that noted a quick look at ‘top’ shows MySQL eating lots of Virtual Memory a quick swap of the configuration file: /usr/share/doc/mysql-server-5.1/examples/my-small.cnf to /etc/mysql/my.cnf sorts out that problem. (Don’t forget to backup your originals)

And finally modifying the WordPress max memory limit as noted in this post
suhosin[10882]: ALERT – script tried to increase memory_limit to 268435456 bytes