I just moved this site to The Rackspace Cloud owing to the fact that it was taking just over 8 seconds to render index.php on occasion. I couldn’t believe that WordPress could be struggling so much on the machine I had it on, but that box is somewhat limited on memory and I was seeing the occasional PHP memory allocation error in the back office.
To be fair, the box that this was installed on is pretty damn terrible. I get the feeling the hosting company it’s with is massively overselling their VPS nodes – sometimes it’s crawling and I’m barely using any clock cycles at all. Another story for another time (again).
Earlier on, the situation looked something like this:

We're waiting...
Rather annoyingly, even on the cloud, the homepage still took a dismal 5 seconds to load (we’re talking just index.php here – none of the files or anything – even with wget there was a considerable latency in the file being generated). Upon pulling the whole lot down and having a good profile in Zend Studio, I was surprised to find that no particular part was really increasing the generation time significantly – the whole bunch of modules, includes and procedures was contributing to the deathly load time equally. The solution? Layer on some optimisations.
I started with some of my usual tricks, eAccelerator, for one is a nice idea to trim off a few hundred milliseconds by caching PHP in its compiled (opcode) state. While this improves the performance of pretty much any PHP application compared to the same execution under “vanilla” PHP. I looked in to some more optimisation techniques specific to WordPress installations. WP Super Cache looked promising. It’s clearly a very well featured plugin and has quite a few nice ideas in there. One idea that I particularly liked was the ability to upload your media library straight to a CDN of your choosing. I immediately uploaded everything I could to Cloud Files and that made a few improvements by reducing the number of simultaneous requests being made to the box – but still the main problem was WordPress itself, combined of course with the various plugins and themes that I’m using.
I thought I’d also give WP Super Cache a go – and I’m glad I did. I was very impressed with the performance improvements it produced (so much so that it’s still installed now). It does have CDN support still, but not the ability to upload straight to the CDN from your wp-admin. For that they suggest CDN Sync Tool – which is also quite well made.

Much better
In any case – the performance issues seem to have subsided. Let’s just hope things don’t go horribly wrong when I post this entry and that the images in it aren’t immediately assumed to be on the cloud. I can feel that coming on right now.