WordPress, caching and RAM usage

A brief technical post. In the past week, I’ve offered this advice to a couple of people, so I thought I might as well write it down here, once and for all.

In running WriteToReply, JISCPress and blogs.lincoln, I’ve learned a bit about optimising WordPress’ use of RAM. Basically, the steps I use are:

  1. wp-super-cache for file caching
  2. eaccelerator (or xcache – don’t use APC, it doesn’t work with wp-super-cache) for PHP caching
  3. MySQL usually comes with a number of sample config files (in /usr/share/mysql/) for small, medium, large and huge servers. Try the medium config file and see how you get on. Compare the variables in each file to understand how you can tweak my.cnf. Also, try tune mysql, though this might recommend more resource for optimal performance.

For your comparison, WriteToReply runs on a minimal Ubuntu VPS with 1.5GB RAM and hosts a small Mediawiki site and a WordPress network  of 34 live sites. I know from experience that reducing RAM to just 1GB will cause the server to freeze within a matter of hours as it runs out of memory.

Got any tips? I’d love to hear about them. Thanks.

4 Replies to “WordPress, caching and RAM usage”

  1. I’m curious why you say that APC doesn’t work with WP Super Cache, I run it along side WP Super Cache on a box that has several multi-site installs, 1 w/~150 sites, another with ~50 and a couple smaller ones with 15-20 each.

    I believe WP Super Cache also has basic object cache support specifically for APC as well.

    1. It’s good to hear of your success with APC. I’ve always experienced white screens when attempting to use APC alongside super-cache. When searching around for this problem, I’ve found that others also experience it. The notes for wp-super-cache explicitly mention using eaccelerator and xcache (see #22 on this page.

  2. I run WordPress on my site, Spyware Review, and I find that you should additionally consider, for security’s sake, to make sure your wp-content/plugins folder is not accessible, and should regularly back up your site. There are several plugins that do that automatically for you. This site is loading quickly for me, though, so your implemented changes are working well.


Comments are closed.