Damn lies and benchmark comparing Apache and Nginx
2nd of June 2008
Today I moved a bunch of sites over from Apache to Nginx but still keeping Squid in between as a http accelerator (I hope to replace Squid with Varnish soon). I did a quick benchmark of a HTML page that is cached by Squid, 4 times via Apache and 4 times via Nginx. The results:
Apache2 ******** Requests per second: 1601.34 [#/sec] (mean) Time per request: 6.268 [ms] (mean) Time per request: 0.627 [ms] (mean, across all concurrent requests) Transfer rate: 13020.50 [Kbytes/sec] received Nginx ******** Requests per second: 1810.02 [#/sec] (mean) Time per request: 5.6435 [ms] (mean) Time per request: 0.5645 [ms] (mean, across all concurrent requests) Transfer rate: 14591.35 [Kbytes/sec] received
That's "only" 13% faster and I had hoped for a bigger difference but the test is very simple and depends on how Squid feels. The other important test would be to see how much less CPU and memory Nginx uses during the stresstest period but that's for another day.
One note: This is Nginx 0.4.3 on Debian Etch. The current stable release is Nginx 0.6.13. I'll need to talk to my sys admins to remedy this. Perhaps it makes a difference on the benchmark, I don't know.