W3 Total Cache Performance Review

Test your own site’s performance with Kernl WordPress Load Testing!

In the world of WordPress performance, you can’t go far without talking about caching plugins. I’ve personally used several different caching plugins throughout my time as a WordPress developer but have never really took the time to see how the plugins perform under pressure. Until now.

Over the next couple of months I’ll be releasing a series of blog posts detailing the performance characteristics of different WordPress caching plugins. This DOES NOT include server caching plugins (LiteSpeed, Varnish, Nginx Fast CGI, etc) because those are in a league of their own and it wouldn’t really be an “apples to apples” comparison.

The Setup

I decided to try and run this comparison as if I were looking for a cheap VPS provider and hoping to get a lot of performance out of it. Since I’m a huge Digital Ocean fanboy, I went ahead and used the pre-built WordPress image in their marketplace and dropped it on a $5/month droplet. This leaves me with a typical LAMP setup with mostly default configurations for everything. I also wanted to test the configuration with Memcachedso that was installed as well.

The Tests

In order to fully test W3 Total Cache I ran the following tests with 200 concurrent users out of Digital Ocean’s NYC3 data center. The server under test was located in Amsterdam.

  • Baseline Test – No caching at all. We just need to see what performance we can get without caching enabled.
  • Fragment Cache Only (Memcached)
  • Database Cache Only (Memcached)
  • Page Cache Only (Memcached)
  • All Caches Enabled (Memcached)
  • All Caches Enabled (OPCode APC)
  • All Caches Enabled (Disk Enhanced[page] & Disk)

It is important to note that W3 Total Cache will also do HTML, CSS, and JS minification. I’m not particularly interested in that, but do know that it can compress these outputs with a variety of different tools and may decrease overall load time.

High Level Results

W3 Total Cache is a solid caching plugin that gives you a lot of different options for getting good performance out of WordPress.

TestMax req/sResponse Time (90%)
Baseline192000ms
Fragment Cache Only192100ms
Database Cache Only202100ms
Page Cache Only601100ms
All Caches (Memcached)131110ms
All Caches (OPCode APC)601800ms
All Caches (Disk)13390ms

Baseline Test

As expected the baseline load test didn’t perform the greatest. It is no secret that WordPress doesn’t perform well under load without caching plugins, but we needed a baseline anyways.

Lots of red.

We peaked at around 19 req/s and then started to trail off towards 5 req/s as the error rate increased. Looking at the response time distribution, you can see that things didn’t look much better.

I mean it could be worse. At least people could access your site in under 5 seconds, but most people bail in 1 second or less.

Fragment Cache Only

The fragment cache in W3 Total Cache is supposed to “reduce time for common operations”. I’m not sure what that means but by itself it didn’t seem to help me out very much.

With fragment caching enabled we still see a similar request and failure profile as when we didn’t have any caching enabled at all.

Response time distribution was similar to no caching. My guess is that fragment caching optimizes a very narrow set of operations and that my blog doesn’t really use any of them.

Database Cache Only

I expected to see some pretty good performance with the database cache enabled. Presumably this cached queries to MySQL with should have really helped us scale. It didn’t 🙁

You can see that we were just slightly better than with the fragment cache, but not even close to where I thought we would be.

The response time distribution was bad too. It actually is a bit higher than the other ones. I assume that this was just a fluke and that if I ran this test several times it would be the same as the others.

Page Cache Only

With full page caching enabled we start to see some good performance improvements.

60 * 60 *60 * 24 == 5.1 Million per day

The graph above shows that we hit about 60 req/s before the wheels start to fall off, but even then we’re able to continue serving requests at a respectable 50-ish req/s.

The response time distribution looks a lot better here as well. 90% of requests finished in 1.1 seconds. This isn’t bad at all considering you’re going at > 50 req/s.

All Caches Enabled (Memcached)

With all caches enabled we start to see some pretty impressive performance out of W3 Total Cache.

Zoom Zoom

130 req/s is solid, but you’ll notice there is a steady stream of errors coming across as well. In general I would say that this setting is good to prevent to your site from going down but that you should look to increasing resources ASAP.

Response time distribution is where we start to see some really excellent gains. The pages were served almost immediately with the 99th percentile being 220ms. Much of that time can be attributed to latency due because the servers are so far apart.

All Caches Enabled (OPCode APC)

I expected the results of this test to be similar to Memcached because they’re both in-memory caches, but that wasn’t even close to true.

What a strange looking chart.

We initially peaked at 60 req/s and then started to see a large uptick in errors. Requests eventually started to climb back up, but the error rate stayed consistent.

I was pretty disappointed in the response time distribution. I expected it to be similar to Memcached but it looks like OPCode APC just isn’t as efficient. 90th percentile at 1.8s isn’t terrible but it isn’t good either.

All Caches Enabled (Disk)

Disk-based caching is very likely the type you would be using if you were in a shared hosting environment. The good news is that the disk-based caching that W3 Total Cache does is quite good.

133 req/s with a fairly small error rate is great! At this level you could easily handle 99% of the traffic scenarios you’ll see as a WordPress developer.

The response time distribution was similar to the Memcached version of this test in that 99% of requests finished in under 170ms. Not bad considering WordPress was fielding > 130 requests per second.

Conclusions

W3 Total Cache is an excellent choice for caching. While some of its configuration can be confusing, you can still get very acceptable performance by enabling page caching or all caching thats available. Its also worth noting that you could very likely get excellent performance with no errors if you tweaked some Apache and MySQL settings in addition to using W3 Total Cache.

Test your own site’s performance with Kernl WordPress Load Testing!

3 thoughts on “W3 Total Cache Performance Review”

    1. Not yet! I suspect performance will be similar though as they are both in memory key-value stores. Has your experience been different?

Comments are closed.