Wordpress load test part 2 - amendment

Posted by Load Impact on Jan 12, 2010

This is the second and a half part in a series of posts about Wordpress and performance. In part 1, we took a look at Wordpress in general. In part 2 we reviewed a couple of popular caching plugins that can boost performance. In this follow up post, we'll tell you a bit about what we learned after part 2 was published.


Revisiting W3 Total Cache

After publishing our results in part 2, we received a concerned Twitter message from Frederick Townes, the W3 Total Cache (W3TC) author. He thought we had done something wrong since the Disk enhanced cache mechanism used in W3TC should be at least as effective as the Wordpress Super Cache plugin (WPSC). After a brief Twitter discussion, we understood that he was absolutely right. The mod_rewrite magic that WPSC uses to achieve the amazing results was indeed present in W3TC as well (and I might as well add that the mod_rewrite rules added by Freredick's plugin is neater than the ones added by the test winner).

The mistake we made in our first test is that we didn't realize the significant difference between the two different disk based page caching methods available. There's "Basic" caching which is the one we tested, and there's "Enhanced mode". In Basic mode, W3TC will work pretty much the same way as the standard wp-cache plugin which involves invoking a PHP script. In our server benchmark, we've already seen that our server will consume in the region of 80ms for doing that so we're glad if we could avoid it in the elegant manner that Wordpress Super Cache does.

In Enhanced mode, surprise surprise, avoiding invoking PHP is exactly what W3 Total Cache will do. The basic concept is the same in W3TC and WPSC, both plugins will add a bunch of lines to the .htaccess file that tells Apache2 to go look for a static copy of (a.k.a cached) version of the requested file/resource. And as noted above, W3TC does this with a slightly more elegant addition to .htaccess. In our defense, even though the documentation provided with W3TC is good, we didn't find anything in particular that explained this significant difference between Basic and Enhanced.

How Load Impact can affect the results

Naturally, we took W3TC back to the lab to see how fast it is in enhanced mode. But before telling you about the results, we want to explain a few details about how Load Impact works. When we ask Load Impact to simulate the load of 50 concurrent web users, that is exactly what Load Impact will do. The second the test starts, exactly 50 virtual users will load the page at the same time and Load Impact will note how long time it takes before the web server responds and the content is completely transferred. Then, each virtual user will make a random pause and try again. Depending on the accuracy settings for the test, this will be repeated over and over again. In a "Fast" test, there will be very few repetitions and in a "Accurate" test, there will be lots and lots of repetitions. The more repetitions, the more data points to use when calculating the average load time. This configuration setting allows users to prioritize test completion time over accuracy if they want to. This behavior actually have some impact when testing cache plugins. When we test, the first time when 50 virtual users comes storming to the test web server at once Apache will fire up as many child processes as it's configured for, 30 in our case. All of these processes will go look in the cache and quite likely discover that there is no cached version of the requested file. So PHP is invoked, Wordpress will generate the page and the cache plugin kicks in and stores the rendered version of the page in the cache. Not only does creating the cached version take more time than a normal page request does, in our scenario, there's a risk that this is done up to 30 times. And to make things even worse, 30 child processes writing to a file based cache exactly the same time will cause a lot of file locking problems that will end up taking even more time.

The conclusion is that depending on the state of the cache when the test begins, the response time of the first 30 data points may vary. And this is exactly what we saw when we took W3 Total Cache back to the lab.

Testing W3 Total Cache again

We retested W3TC again and arrived at these numbers:

Wordpress baseline: 1220 ms

W3 Total Cache (basic disk): 256 ms (-79.0%)

W3 Total Cache (enhanced disk): 188 ms (-84.6%)

That's a solid improvement so we contacted Frederick again with the good news only to be turned down again, "something is still wrong" he told us. Then we redid the test for Enhanced mode and over again with minor tweaks to the W3TC settings. After every tweak, we cleared the cache so that any cached pages specifics wouldn't interfere with the current settings. We saw slightly higher average load times as well as slightly lower, but we were never close to the 112 ms record set when using the Wordpress Super Cahce plugin. Until the "warm vs cold" cache issue hit us and we did a test with a warm cache. And boom! The average load time decreased all the way down to 109 ms, better than what WPSC would acheive. So let's add how W3TC performs using enhanced disk caching:

Using Enhanced disk cache:

Average load time 50 users: 109 ms

Baseline difference: -1111 ms

Baseline difference %: -91.1%





Before updating the results table, we retested the other results as well, but the number we ended up with in the retests was all within a 5ms difference from the original test result, so we're sticking with the results from our first round of tests. But we're reducing to using just 2 significant figures:

Plugin Avg. load time Difference Difference %
Standard Wordpress 1220 0 0 %
wp-cache 210 -1010 -83 %
batcache 537 -683 -56 %
WP Super Cache 112 -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 %

That's it.

Topics: performance, wp-cache, load test, wordpress, w3 total cache, plugin, blog software, batcache, wp super cache, Load Testing, Blog

Recent Posts

Popular posts

Posts by Topic

see all

Subscribe to Email Updates