Benchmarking Wordpress with Apache Bench
A lot of people talk about Wordpress performance, and how to get a webserver to perform as efficiently as possible. However, without a quantifiable methodology to testing website performance, you can’t actually talk about it. ApacheBench (ab) is the solution to the problem of measuring website performance. What is ApacheBench? The man page provides a suitable answer:
ab – Apache HTTP server benchmarking tool
ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
If you have installed apache or apache-devel, you should be to simple invoke ab by typing it on the command line. For example, to benchmark my own site here, I would write:
[root ~]# ab -n 10000 -c 100 http://elliottback.com/wp/
This says “make 10,000 concurrent requests to host elliottback.com via http and request /wp/ on 100 threads.” The result of this is the following report:
This is ApacheBench, Version 2.0.40-dev < $Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking elliottback.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requestsServer Software: Apache/2.2.6
Server Hostname: elliottback.com
Server Port: 80Document Path: /wp/
Document Length: 34331 bytesConcurrency Level: 100
Time taken for tests: 13.596345 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 346230000 bytes
HTML transferred: 343310000 bytes
Requests per second: 735.49 [#/sec] (mean)
Time per request: 135.963 [ms] (mean)
Time per request: 1.360 [ms] (mean, across all concurrent requests)
Transfer rate: 24868.08 [Kbytes/sec] receivedConnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 20
Processing: 8 134 12.7 132 190
Waiting: 4 134 12.7 132 190
Total: 16 134 12.1 132 190Percentage of the requests served within a certain time (ms)
50% 132
66% 134
75% 136
80% 137
90% 145
95% 160
98% 175
99% 179
100% 190 (longest request)
According to these numbers, my dual core server can do 750 requests per second, fulfilling each within about 150ms each. That’s pretty fast, probably because I know the secrets of Wordpress Optimization. If you make every layer as fast as it can be, and cache heavily, you too can see lightening fast Wordpress installations!
| This entry was posted on Monday, January 14th, 2008 at 5:38 pm and is tagged with zeus technology ltd, adam twiss, apache software foundation, apache http server, apache installation, concurrency level, document length, concurrent requests, suitable answer, server hostname, document path, apache 2, server port, man page, server software, benchmark, wordpress, wp, bench, methodology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback. |



My Score on godaddy vps
This is ApacheBench, Version 2.0.40-dev apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking tuffclassified.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: Apache/2.2.3
Server Hostname: tuffclassified.com
Server Port: 80
Document Path: /
Document Length: 122550 bytes
Concurrency Level: 100
Time taken for tests: 6.340205 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1231010000 bytes
HTML transferred: 1225500000 bytes
Requests per second: 1577.24 [#/sec] (mean)
Time per request: 63.402 [ms] (mean)
Time per request: 0.634 [ms] (mean, across all concurrent requests)
Transfer rate: 189608.69 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 7
Processing: 5 62 15.0 56 124
Waiting: 4 61 14.4 55 121
Total: 5 62 15.0 56 124
Percentage of the requests served within a certain time (ms)
50% 56
66% 63
75% 71
80% 76
90% 86
95% 93
98% 100
99% 105
100% 124 (longest request)
Here is more fresh benchmarks
http://allbenchmarks.com/p/cms-group-test
my stats > yours!!!
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking http://www.unkown.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache/2.2.14
Server Hostname: http://www.unknown.com
Server Port: 80
Document Path: /index.php
Document Length: 39125 bytes
Concurrency Level: 25
Time taken for tests: 109.081 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 39409000 bytes
HTML transferred: 39125000 bytes
Requests per second: 9.17 [#/sec] (mean)
Time per request: 2727.024 [ms] (mean)
Time per request: 109.081 [ms] (mean, across all concurrent requests)
Transfer rate: 352.81 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 6
Processing: 2135 2702 689.7 2615 8070
Waiting: 1188 1571 583.6 1345 7017
Total: 2135 2703 689.9 2615 8071
Percentage of the requests served within a certain time (ms)
50% 2615
66% 2764
75% 2827
80% 2877
90% 3038
95% 3916
98% 4731
99% 6895
100% 8071 (longest request)
ab -c 100 -n 10000 http://giantdorks.org/
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking giantdorks.org (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache
Server Hostname: giantdorks.org
Server Port: 80
Document Path: /
Document Length: 9683 bytes
Concurrency Level: 100
Time taken for tests: 3.488 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 100589814 bytes
HTML transferred: 97430346 bytes
Requests per second: 2866.81 [#/sec] (mean)
Time per request: 34.882 [ms] (mean)
Time per request: 0.349 [ms] (mean, across all concurrent requests)
Transfer rate: 28161.31 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 16 3.2 16 47
Processing: 5 19 4.2 18 48
Waiting: 1 10 5.9 10 46
Total: 11 35 4.7 34 69
Percentage of the requests served within a certain time (ms)
50% 34
66% 35
75% 35
80% 36
90% 36
95% 38
98% 50
99% 62
100% 69 (longest request)
As of this writing, giantdorks.org runs on WordPress MU. Varnish takes requests on port 80 and passes to Apache, which does the heavy lifting.
This runs on a $10/month Xen VPS with 512MB of RAM. Varnish/Apache/MySQL on the same box.
Try reading the man page for ab.
ab -n 10000 -c 100 http://elliottback.com/wp/
does NOT mean “make 10,000 concurrent requests to host elliottback.com via http and request /wp/ on 100 threads”
read what the -c and -n options do.
Thanks.
Are you being intentionally obtuse? It means make 10,000 requests, which are concurrent, at most 100 at a time. I.e., 100 at a time, service 10,000 requests concurrently.
No. It means make 100 concurrent connections, and test until 10000 requests are made. Do you read the man pages? Are you being intentionally arrogant?
[...] If you’ve thought about whether upgrading from WP Cache 2.0 to WP Super Cache is a good idea, hopefully this benchmark will convince you. I followed my instructions on benchmarking Wordpress with Apache Bench on four configurations of this blog’s main page to measure performance: [...]
Your score is really high. I also made testing on clean WordPress, than I turned on MySQL and PHP caching and finally I install WP-Cache. My testing environment was dual core P4 2.6Ghz with 1Gb of memory. In the beginning WordPress was able to deliver 3.44 request per second and after turning on caches, I got 467 requests per second.
Yeah. if you figure out the key/value pair for the WP login cookie, just specify as a param “-C cookie-name=value” for each one.
Do you know how to perform a test that would involve cookies (i.e. wordpress login)?
I’ve followed most of your suggestions, but for some reason I can’t get more than 13-14req/sec out of my server and I’m at a loss as to while.
Some people have suggested it’d because I utilize PLESK as my management console, I know it’s not.
I’m on a Celeron 2.0Ghz w/ 1G memory – plenty fast enough to handle 250-300 requests/sec.
As proof, I ran ‘ab’ against apc.php (apc profiler) and it handled about 300 req/sec.
Against my wordpress install, it stuck at around 12-14/sec AND.. it shows “HTML transfered: 1 Bytes”
For some reason, ab isn’t actually hitting the site. Weird, no? Any thoughts?
Nice write-up.
Just a question: do you really need to set these numbers so high? Can’t I get a decent result with 100 requests in 3 threads?
Also, I hear ‘ab’ does not use reverse proxies and thus does not show the actual performance a webserver can generate?