Blog

Wordpress load test part 2

NOTE: This post was updated after it was first published. Please click here for explanation.

This is the second part in a series of posts about
Wordpress and performance. In part 1, we took a look at Wordpress in general. In this part, we'll continue the investigation and look at a few specific plugins that can help improve performance.

First things first, in part 1, we used a 8Gb Quad core server for the tests. From now on, we've moved to a KVM virtual server. The main purpose of that is that we change the machine configuration when something interesting is discovered. For instance, if we discover a performance problem and suspect RAM memory to be the bottleneck, we can add memory to the machine and rerun the test. The obvious downside is that the baseline established in part 1 isn't valid anymore. So the first task is to examine how this virtual machine handles load as described in part 1.

The base configuration for the virtual server is 2 CPU cores running at 2.1 GHz with 1024 MB RAM memory. The OS Ubuntu JEOS upgraded to 9.04. Apache2 is at version ___, PHP5 is up to version  . The MySQL server is located on the same machine and is running 5.xxx. Wordpress is upgraded to version 2.9.1.

The baselines. A simple PHP script that sends 10 bytes of data back to the user has an average load time of 85 ms when running 80 concurrent users. That's actually pretty much the same number as we saw on the 8Gb Quad core machine, we had 80.9 ms on that machine.

Next thing we looked at in the first part was the average load time for a basic empty Wordpress install. On the Quad core box, we saw an average load time of 357 ms for 80 users. On the virtual machine, not so good. A ramp up test going from 50 to 80 concurrent users shows load times at 691 ms for 50 users and more or less infinite at 60 users. At that load level, the kswapd process was eating away a good 66% of all available CPU, meaning that the server spent most of it's time swapping pages back and forth between RAM and disk. Even if nothing actually crashed, we aborted the test and concluded that the current config can't handle more than 50 concurrent users.

For the final baseline test we added 10 posts into the Wordpress install and made a new measurement. On our virtual machine, 50 users gave us a load time of 1220 ms, the same load on the Quad core machine gave us 470 ms response times. Clearly, taking away 2 processor cores and slashing the RAM memory to 1/8th affects average load times badly which is not surprising at all. Anyway, we now know that our current test environment is unlikely to handle more than 50 concurrent users and we also know what happens if we add RAM and/or CPU cores.

 

Tweaking Wordpress performance

There are numerous of ways to increase wordpress performance and we'll have a look at how the numbers gets affected in this particular installation. Now, Wordpress wouldn't be Wordpress if the most interesting performance tweaks was already packaged as easy to use plugins, so instead of digging deep into the Wordpress core, we ended up evaulating a set of interesting plugins, here they are:

wp-cache plugin

The wp-cache plugin have become very popular way to add a chache to Wordpress. Wordpress used to have a built in object cache, but that got cancelled in Wordpress 2.5. So today, the wp-cache plugin is one of the most obvious plugins that come to mind when wanting to tweak Wordpress performance (and yes, we'll look at wp-super-cache as well). The test result with wp-cache is very good. As we've seen above, this server will need 85 ms to server the simplest possible PHP script and the wp-cache plugin gets us fairly close to that ideal number.

Average load time 50 users: 210 ms

Baseline difference: -1010 ms

Baseline difference %: -82.9%

 

batcache plugin

Batcache was written to help WordPress.com cope with the massive and
prolonged traffic spike on Gizmodo's live blog during Apple events.
Live blogs were famous for failing under the load of traffic. Gizmodo's
live blog stays up because of Batcache. The developers of Batcache actually refer to WP Super Cache themselves as a better alternative, but in some cases with multiple servers and where memcached is available, Batcache may be a better solution. The performance gains with Batcache is actually not up to par with what wp-cache or WP Super Cache delivers, but it's still a lot better than a standard Wordpress install.

Average load time 50 users: 537 ms

Baseline difference: -683 ms

Baseline difference %: -56.0%

 

WP Super Cache plugin

The WP Super cache plugin takes things a few step further compared to the standard wp-cache. Most notably, by using a set of Apache2 mod_rewrite rules, WP Super cache is able to serve most of your Wordpress content without ever invoking the PHP engine, instead the content is served at the same speed as it would serve static content such as graphics or javacsript files. Installing this plugin is a little bit more complicated and it requires both mod_headers and mod_expires Apache2 modules to be enabled. But once installed, it really works, just look at the numbers! If using the WP Super Cache plugin works on your server, it's probably the easiest and most powerful way to boost your Wordpress performance numbers. And if it doesn't work as intended on your server, the good thing is that it reverts back to the functionality provided by the standard wp-cache plugin.

Average load time 50 users: 112 ms

Baseline difference: -1108 ms

Baseline difference %: -90.8%

 

 

W3 Total Cache plugin

The W3 Total Cache plugin is a powerful plugin that takes the best from wp-cache and batcache and adds a few additional features to improve performance. W3 Total cache allows the user to choose between disk and memory based caching (using memcached). It also supports minifying HTML, JS and CSS files as well as the various types of http compression (deflate, gzip etc.). Finally, W3 Total cache supports placing content on a content delivery network (CDN) that can speed up loading of static content even further. W3 Total Cache have a lot of configuration options and we did not take the time to fully investigate them all. We did test the performance difference when using disk based caching and memory based caching and the difference is actually notable. We enabled minifying and compression but we've pretty much used everything else 'out of the box'.

Using disk cache:

Average load time 50 users: 256 ms

Baseline difference: -964 ms

Baseline difference %: -79.0%

 

Using memory cache:

Average load time 50 users: 367 ms

Baseline difference: -853 ms

Baseline difference %: -70.0%


Summary

Results

NOTE: This table was updated after it was first published. Please click here for explanation.

PluginAvg. load timeDifference

Difference %

Standard Wordpress12200

0 %

wp-cache210-1010

-83 %

batcache537-683

-56 %

WP Super Cache112-1108

-91 %

W3 Total Cache (disk basic)256-964

-79 %

W3 Total Cache (disk enhanced)109-1111

-91 %

W3 Total Cache (memcache)367-853

-70 %

 

Conclusions

The various performance related plugins for Wordpress all revolves around caching. The most impressive results was acheived using WP Super Cache and W3 Total Cache. Among the other plugins, the choice is between disk based caching and memcached based caching. Our tests actually show that disk is faster, but that's something that needs to be explored further. The tests have been done on a blog with very little data in it and Linux uses a fair amount of disk caching that is probably more effective with these particular amounts of data. Whenever WP Super Cache is not possible to use (or simply feels too exotic for you), we suspect that a perfectly tuned W3 Total Cache is the best choice. W3 Total Cache shows the most potential for tuning and we like the overall 'look-and-feel' of it. UPDATE: Actually, after retesting W3 Total Cache, we think it may an even better alternative than WP Super cache. The one negative thing we've picked up so far is a potential compatibility issue with Wordpress Multi User (WPMU), but we have not been able to confirm that.

 

Feedback

We want to know what you think. Are
there any other specific plugins that you want to see tested? Should we
focus on tests with more users, more posts in the blog, more comments?
Please comment on this post and tell us what you think.

 

 

 


11 Responses to Wordpress load test part 2

  1. 46 Lars Tong Strömberg 2010-01-10 22:55

    Interesting comparison. Using WP Super Cache already, but will try to focus more on performance in the coming months trying to eliminate plugin culprits. Tweetmeme on its way out e.g.

  2. 47 Erik Torsner 2010-01-11 01:35

    Thanks Lars, any experience on how WP Super cache work/doesn't work together with other plugins? I can't escape the feeling that it's too good to not have implications on functionality.

  3. 48 Nikke Lindqvist 2010-01-11 11:46

    I agree with Lars. Thanks for the comparison. Glad to see I'm on the right track with WP Super Cache.

    As to Erik's question. The only unexpected behaviour I have experienced and that I blame on WP Super Cache is with mobile theme I use on Lindqvist.com: the WPTouch iPhone Theme that won't switch over between mobile and non-mobile mode as it should. On the other hand, i see this more as a problem for the WPTouch iPhone theme since I prioritize speed.

  4. 49 sunnybear 2010-01-11 17:44

    It seems only a few WP plugins utils are covered. WEBO Site SpeedUp - http://www.web-optimizer.us/ - can get about 95% prformance over baseline.

  5. 50 Erik Torsner 2010-01-11 21:53

    sunnybear,

    A follow up post is in the works. We're adding a more details to the W3 Total Cache test since the current test didn't include the most optimal mode "Extended disk cache". We're happy to include WEBO as well since it's claiming to gain up to 98% increase. Stay tuned.

  6. 56 Yaakov Albietz 2010-01-27 19:01

    looking forward to seeing the additional tests.
    I assume that you testing using your loadimpact.com service?

    One thing that would be really cool is to embed links that allow visitors to test their site and see how it compares with each result.

  7. 57 Ben 2010-01-27 21:16

    Wordpress can be hosted on IIS as well and some of the cache plugins are poorly supported on IIS. Some of the developers tend to ignore it even though their plugin will run on it. They just don't make it easy.

  8. 59 teson 2010-01-29 00:28

    Would be interesting to see the results accompanied with php-accelerator such as apc or eaccelerator.

    regards
    /t

  9. 64 itfarmer 2010-02-13 01:45

    Thanks for the benchmark.
    It is very useful for people using these plugins

    David

  10. 78 Dieter 2010-04-05 10:19

    Good article. Thanks for providing the results of your tests.

    My WordPress driven website is used with a database cache only: DB Cache Reloaded

    I tested WP Super Cache and wp cache. The results with different configurations showed in my Google Webmaster Tools an increase of loading time. Causative for that should be the low number of visitors. The first visitor of a page have to wait longer. It needs more time for the server to build a static page that will be saved on the server and served for later visitors.

    After deinstallation everything went fine again.

    However, there could also an impact of missing experience with caching technics and the best configuration of the plugins for my WordPress website.

  11. 97 RAR 2010-05-21 20:47

    I think W3 Total Cache (disk enhanced) for page cache and APC for database cache is the best caching solution

    Thanks for the benchmark

Leave a Reply