Tue 27 Feb 2007
Since I spent so much time getting CakePHP caching working the way I wanted I figured I’d run a quick performance test. I used ab - the ApacheBench command line tool. The command I used is pretty basic, 10 concurrent requests for 60 seconds:
ab -c 10 -t 60 http://camxip/home
First without caching, trimmed for relevent results:
Finished 183 requests
Concurrency Level: 10
Time taken for tests: 60.130900 seconds
Complete requests: 183
Failed requests: 0
Write errors: 0
Total transferred: 1294343 bytes
HTML transferred: 1227919 bytes
Requests per second: 3.04 [#/sec] (mean)
Time per request: 3285.842 [ms] (mean)
Time per request: 328.584 [ms] (mean, across all concurrent requests)
Transfer rate: 21.02 [Kbytes/sec] received
The same test with cache enabled:
Finished 498 requests
Concurrency Level: 10
Time taken for tests: 60.171278 seconds
Complete requests: 498
Failed requests: 0
Write errors: 0
Total transferred: 3514318 bytes
HTML transferred: 3334179 bytes
Requests per second: 8.28 [#/sec] (mean)
Time per request: 1208.259 [ms] (mean)
Time per request: 120.826 [ms] (mean, across all concurrent requests)
Transfer rate: 57.02 [Kbytes/sec] received
The net results are a 2.7x increase - a pretty significant number.
The point of all this is that you really have to think about caching as your designing and building your app. Although it seems like a switch you can just flick at your convenience, that is hardly the case for any site that has sections specific to the user.
Popularity: 16% [?]










Follow!