Benchmarking WordPress, simple load & speed testing with ApacheBench

WordPress load testing with ApacheBench. ab is a small benchmark utility that comes with Apache. It’s a really simple HTTP load generating tool, ideal for a simple WordPress load & speed test. How fast does your WordPress site respond? How many HTTP requests per second can your server handle? These are questions on which ab can shed some light.

Note: this is an older post, moved from another blog of mine.

Suppose you want to see how fast your website can handle 100 requests, with a maximum of 10 requests running concurrently. For this you use ab:

ab -n 100 -c 10

This’ll generate the following output:

Concurrency Level:      10
Time taken for tests:   2.219 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      1261400 bytes
HTML transferred:       1225500 bytes
Requests per second:    45.07 [#/sec] (mean)
Time per request:       221.897 [ms] (mean)
Time per request:       22.190 [ms] (mean, across all concurrent requests)
Transfer rate:          555.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   14   5.3     13      48
Processing:   157  201  47.5    189     364
Waiting:      142  186  47.4    174     353
Total:        170  215  49.2    203     383

Percentage of the requests served within a certain time (ms)
  50%    203
  66%    208
  75%    212
  80%    214
  90%    261
  95%    369
  98%    382
  99%    383
 100%    383 (longest request)

This is very useful information.

As you can see, the benchmarked WordPress site returned requests at 45.07 requests per second, the fastest was 170 ms, the slowest 383 ms.

Using ApacheBench, or ab, you can easily benchmark your WordPress website with various PHP versions and configuration settings.

Benchmarking various PHP versions

Using ApacheBench, I benchmarked various PHP versions. The tested PHP versions are 5.5.30, 5.6.19 and 7.0.4, with and without Wincache, and the results are somewhat surprising, as you can see for yourself:

Interesting:   Minify WP-Super-Cache HTML cache files: WPSCMin a WP-Super-Cache plugin
PHP version benchmark at a vanilla WordPress site
PHP version Requests per second (#/sec) Fastest (ms) Slowest (ms)
7.0.4 & Wincache 45.07 170 383
7.0.4 46.34 163 370
5.6.19 & Wincache 48.63 149 390
5.6.19 49.85 143 400
5.5.30 & Wincache 38.16 151 546
5.5.30 54.79 129 403

Not only does PHP 5.5.30 handle the most requests per second, it’s even the fastest in this test.

All benchmark tests were performed on a shared web server running Windows Server 2012 R2 and IIS 8.5. Every time I made sure the application pool was active.

Caveat: because of the server being a shared hosting web server, there may have been load peaks during testing interfering with the results – but not that I have noticed.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.