Benchmarking WordPress, simple load & speed testing with ApacheBench

Reading Time: 2 Minutes
It's only fair to share...
Share on Facebook3Tweet about this on TwitterShare on LinkedIn1Share on Google+2

ApacheBench, or 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.

Advertisement:

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:

ab -n 100 -c 10 http://www.example.com/

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:

Related:   WordPress advisory: Akal premium theme XSS vulnerability & abandonded
PHP version benchmark at a vanilla WordPress site
PHP versionRequests per second (#/sec)Fastest (ms)Slowest (ms)
7.0.4 & Wincache45.07170383
7.0.446.34163370
5.6.19 & Wincache48.63149390
5.6.1949.85143400
5.5.30 & Wincache38.16151546
5.5.3054.79129403

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.

It's only fair to share...
Share on Facebook3Tweet about this on TwitterShare on LinkedIn1Share on Google+2

Advertisement:

One Reply to “Benchmarking WordPress, simple load & speed testing with ApacheBench”

Hi! Join the discussion, leave a reply!