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.

Apache Bench, or ab, is available in apache2-utils, that you can easily install using apt install apache2-utils on Ubuntu.

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 Apache Bench, or 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)

As you can see, 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.

Read this too:   How to flush MySQL query cache from time to time

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:

PHP versionRequests per second (#/sec)Fastest (ms)Slowest (ms)
7.0.4 & Wincache45.07170383
5.6.19 & Wincache48.63149390
5.5.30 & Wincache38.16151546

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.

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

Did this post helped you solve a problem? Or dit you find it interesting? Support Sysadmins of the North with a direct donation via Paypal of by bank wire transfer IBAN: NL31 ABNA 0432217258 (Jan Reilink). Just $ 5,- or € 5,- is more than enough, thanks!



Leave a Reply

Your email address will not be published. Required fields are marked *