One of the downfalls of WordPress, and just about every other CMS on the planet, is that they are slow and processor/memory hungry. There’s a tremendous amount of overhead due to legacy functions, ability to extend (plugins and themes), and other fun things that you wonít ever use. I’ve been screwing around with WP + Nginx + w3 supercache + XCache/writing cache to disk. The goal is to see how fast I can make WordPress (without slashing up the core). In case you haven’t heard of w3 Supercache, it’s a nifty plugin for WordPress. It caches the output html that’s generated when you visit a page. This cuts down on the stuff (querying the database, loading all the theme files, running the core, etc) your server needs to do. For my testing, I’m using a High-CPU Medium EC2 instance (c1.medium) which has 1.7GB of ram and 5 EC2 Compute Units.
Tests: (Times below are only for the initial page, none of the includes or images. I’m using the theme TwentyTwelve and hitting the homepage of a clean install.);
- Vanilla install of Nginx: Load times hover around 300-450ms
- Nginx + W3 Super Cache (set to cache to disk): 200-250ms
- Nginx + W3 Super Cache (set to cache to XCache): 150-200ms
Results: Better, but not nearly as fast as I hoped. (I really shouldn’t be disappointed. 200ms is very fast.);
I was hoping to be closer to the 100ms mark. I thought using XCache would’ve helped more. It’d be interesting to try using memcache instead of XCache. Judging by my configuration, I doubt that the bottleneck is the server. Instead, it’s most likely the internet (Time Warner, I’m looking at you.) My average ping response time to the server is about 80ms. Which means (on average) it’s taking Nginx about 120ms to package everything and shoot it across the tubes.
Lessons learned: Just having W3 supercache installed (with “Cache to Disk” configured) cuts load times down by ~50%. I’m going to start using it more often!
Interesting. I believe WPEngine uses Varnish to cache things. I would be curious how much that speeds it up compared to XCache.