Thursday, September 2, 2010

Hack of the Day: Speeding Up WordPress on a VPS

Hack of the Day: Speeding Up WordPress on a VPS: "

wordpress_cache_0810.jpgOne of the most common suggestions to bloggers who use shared hosting is that they will be much better off with a VPS or a dedicated server. I agree in principle; however, this doesn't mean the server will run smoothly without a bit of tweaking.

I'm currently in the process of moving several WordPress blogs from a dedicated server to a VPS. After moving five or six blogs, I noticed the server was slowing to a crawl, with high load after just a week of uptime. None of the blogs are particularly busy. What would solve this problem?


A quick way (no pun intended) to speed up WordPress is to install WP-SuperCache. This is the first thing I tried, but I didn't notice much of an improvement.

Server Security

Security configuration changes may help if the slowness is caused by people exploiting weaknesses on your server. But this didn't help either.


The trick that worked for me was to install php-apc. Assuming you've got access to the command line and it's a Linux box, installation is simply a case of issuing the following command:

sudo apt-get install php-apc

This may vary depending on your Linux distro.


Installing php-apc has reduced the server load from a peak of 30 or 40 right down to a peak of 0.5, and the server has been happily running for a few days without any major problems.

Photo by Mykl Roventine: Out & About