// 22.Nov.2009

Accelerating My WordPress Installation (Redux)

A long time ago, in a galaxy far, far away… oh sorry, wrong script. I’ll start over. In the dim and distant past, I wrote about my efforts to eke a little bit more performance out of the WordPress installation that this glorious website runs upon. What I’d done was fairly basic: content compression, reduced page weights, database tuning… the usual stuff.

I also described how I’d failed to get WP Super Cache working and wrote that I was investigating PHP accelerators. Yet, despite my endeavours, the website’s performance continued to be, well, pitiful. Some time later I managed to get WP Super Cache working and things improved, but were still disappointing to me.

I come from a mod_perl background and one of mod_perl’s strengths is the speed at which it can run its applications. The PHP app’s that I now find myself working with just can’t compete. I believed that I’d just have to accept that the performance goals I was aiming for weren’t achievable.

However, I was recently forced to reconsider my position when I was contracted to build a website on top of the Zend Framework — because, despite being written entirely in PHP, nursesstore.co.uk turned out to be very fast.

Suddenly, I knew that it was possible to build fast PHP applications. So I turned my attention, once again, to the speed-deficient Urban Mainframe with the fire of the true zealot burning in my eyes.

I’d read about the performance improvements that accelerators like APC can provide and I’d half-heartedly tried a couple of times to get it running on my Media Temple GS server. Yesterday I actually managed to get the thing running and I saw immediate improvements in the speed and responsiveness of the Urban Mainframe.

Whilst I was researching the APC software I came across a reference to something called W3 Total Cache and, as I read about it, I began to get very excited about its features and the apparent benefits it offered. So I installed and configured it and it is now working away in the background — improving the performance of this site with an aggressive caching policy.

W3 Total Cache has the ability to transparently integrate with a CDN to further improve on a website’s performance. In order to benefit from this, I set up a sub-domain on this site to handle its static assets and linked that in with the W3 Total Cache configuration.

To summarise then: I’ve made three big changes to the site’s architecture in my quest for a speed boost.

  1. APC bytecode and object cache
  2. W3 Total Cache for cache management and integration
  3. Sub-domain based CDN for asset delivery

There’s still a lot of work to do in order to take full advantage of the new architecture — I’m only managing a Grade D in YSlow at the moment — but I’ll continue to refine things until I get that Grade A.

Let’s see how we’re performing at the moment:

Concurrency Level:      10
Time taken for tests:   91.877 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      9861992 bytes
HTML transferred:       9406000 bytes
Requests per second:    10.88 [#/sec] (mean)
Time per request:       918.771 [ms] (mean)
Time per request:       91.877 [ms] (mean, across all concurrent requests)
Transfer rate:          104.82 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      168  405 443.4    173    3151
Processing:   414  505  95.6    480    1465
Waiting:      226  305  73.7    285    1272
Total:        589  910 457.9    673    3792
Percentage of the requests served within a certain time (ms)
50%    673
66%    723
75%    911
80%   1548
90%   1621
95%   1669
98%   1827
99%   2586
100%  3792 (longest request)

The output from ab (above) is encouraging. It’s still slower than nursesstore.co.uk but it’s certainly a lot quicker than it was before and the “10.88 requests per second” is certainly acceptable.

Is it Digg-proof? I suspect not. But it’s faster and more responsive than it’s ever been and there’s still areas where I’ve got room to improve things.

Still to do then:

  • Implement memcached
  • Transition ALL static files to the CDN sub-domain
  • Achieve the YSlow Grade A
  • Reduce page weight

Last Revision: November 22nd, 2009 at 01:52

4 Comments for “Accelerating My WordPress Installation (Redux)”

  1. Great job Jonathan. You’ll find that the upcoming release of W3TC will make it even easier to reduce file weight, implement an aggressive browser caching policy, utilize enhanced browser pipelining or CDNs and most importantly cache database queries and pages themselves. Also note, that in the ini/ directory inside the plugin itself is a _htaccess file with numerous directives that you can use on your subdomain or on your WordPress site itself to implement some full featured browser caching for your site.

  2. @Frederick: I await every release with baited breath. Seriously, I think you guys have produced the best of all the WordPress caches here. W3TC has given the biggest performance increase of any of the similar plugins I’ve tried on this site.

    You guys have done a great job. Kudos.

  3. I’m finding these articles fascinating and I’m storing them away for future use mate.

  4. That’s good to know Kevin. That’s the kind of feedback that makes it all worthwhile. Thank you.

Contribute to the Discussion:

The comment handler is Gravatar enabled.