
Results overview
There is a classical method to increase the performance of web site that consists in caching the HTML pages that are rendering to the client.
That avoids the server to execute the code to request the database and to render the page. The pre-formatted HTML page is generally stored in the file system.
I would like to try it with this workload (that is perfect for caching because there is no specific information linked to the visitor).
I could use many methods:
- caching with apache
- caching with varnish
- caching with a specialized PHP code
I decided to use the third method as there are a lot of existing WordPress plugins that do the job.
I installed the wp super cache plugin and did a new series of tests.
Test #17, WP Super Cache Plugin, APC activated, 1 Front, 4Vcpu, 2GB on server ade-esxi-02 (Intel(R) Core(TM) Quad CPU Q6600 @ 2.40GHz; No Hyperthreading; 8 GB DDR2 800) :
$ ab -kc 100 -n 1000 http://tu-web-01/mysite/
Requests per second: 1298.79 [#/sec] (mean)
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking tu-web-01 (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.22
Server Hostname: tu-web-01
Server Port: 80
Document Path: /mysite/
Document Length: 39912 bytes
Concurrency Level: 100
Time taken for tests: 0.770 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 40218000 bytes
HTML transferred: 39912000 bytes
Requests per second: 1298.79 [#/sec] (mean)
Time per request: 76.995 [ms] (mean)
Time per request: 0.770 [ms] (mean, across all concurrent requests)
Transfer rate: 51010.45 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.8 1 4
Processing: 12 72 10.4 74 109
Waiting: 6 69 10.4 71 93
Total: 16 73 9.8 74 110
Percentage of the requests served within a certain time (ms)
50% 74
66% 76
75% 77
80% 78
90% 81
95% 83
98% 87
99% 88
100% 110 (longest request)
dstat shows a 35% CPU (idle at 65%)
----cpu0-usage--------------cpu1-usage--------------cpu2-usage--------------cpu3-usage-----------total-cpu-usage---- -net/total- -dsk/total- ---system-- ------memory-usage----- ---load-avg--- ---procs--- ----swap--->
usr sys idl wai hiq siq:usr sys idl wai hiq siq:usr sys idl wai hiq siq:usr sys idl wai hiq siq:usr sys idl wai hiq siq| recv send| read writ| int csw | used buff cach free| 1m 5m 15m |run blk new| used free>
17 5 62 0 0 16: 25 11 65 0 0 0: 24 8 68 0 0 0: 23 11 66 0 0 0: 22 9 65 0 0 4| 979k 20M| 0 0 |4227 1563 | 208M 23.8M 147M 1625M|0.71 0.78 0.51|9.0 0 0| 0 508M>
19 5 63 0 0 13: 28 7 65 0 0 0: 26 10 64 0 0 0: 24 9 67 0 0 0: 24 8 65 0 0 3| 956k 21M| 0 0 |3842 1638 | 209M 23.8M 147M 1623M|0.71 0.78 0.51| 0 0 1.0| 0 508M>
Rem:
As you can notice, I ran this test with 100 simultaneous connections and a total of 1000 connections.
Testing as usual with 10 simultaneous connections and a total of 100 connections is too fast. In this condition, the number of request per sec is roughly 1000 req/sec
Again this test is ideal as the HTML pages can be cached without any problems (no information linked to the visitor), but what happens if there are.
Test #18, WP Super Cache Plugin on a post with a comment, APC activated, 1 Front, 4Vcpu, 2GB on server ade-esxi-02 (Intel(R) Core(TM) Quad CPU Q6600 @ 2.40GHz; No Hyperthreading; 8 GB DDR2 800) :
In this test, we show that the cache is not active when viewing a post with a comment leaved by a visitor (as stated in the readme of the plugin)
$ ab -kc 10 -n 100 http://tu-web-01/mysite/index.php/test3/
Requests per second: 13.64 [#/sec] (mean)
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking tu-web-01 (be patient).....done
Server Software: Apache/2.2.22
Server Hostname: tu-web-01
Server Port: 80
Document Path: /mysite/index.php/test3/
Document Length: 14966 bytes
Concurrency Level: 10
Time taken for tests: 7.330 seconds
Complete requests: 100
Failed requests: 91
(Connect: 0, Receive: 0, Length: 91, Exceptions: 0)
Write errors: 0
Keep-Alive requests: 0
Total transferred: 1557288 bytes
HTML transferred: 1496488 bytes
Requests per second: 13.64 [#/sec] (mean)
Time per request: 733.025 [ms] (mean)
Time per request: 73.303 [ms] (mean, across all concurrent requests)
Transfer rate: 207.47 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.2 0 9
Processing: 469 712 111.1 705 1017
Waiting: 433 631 99.0 628 912
Total: 470 713 111.2 706 1017
Percentage of the requests served within a certain time (ms)
50% 706
66% 749
75% 780
80% 800
90% 860
95% 910
98% 988
99% 1017
100% 1017 (longest request)
Conclusion on using WP super cache
The following graph shows an increase of performance in an order of magnitude of 100

Cache Influence on req/sec



