Here are the benchmark results.
It turned out that it’s a false claim. Apache 2.4 is actually much slower than Nginx!
The benchmark was run on the same Linux box (localhost), to avoid possible network affection. I used ab (ApacheBench) as the benchmark client. Apache listened on port 80 and Nginx listened on port 81. In the whole benchmark process, Apache was stressed first then Nginx. There was a 60 seconds sleep between each test, which was taken by five times per concurrency (from 100 to 1000). I gave up the tests with higher concurrencies because Apache was so unstable with concurrency greater than 1000 that there would be some failures. While Nginx was very stable without problems.
I’ve tried my best to fully “unleash the power of Apache”:
1) configured with apr-1.4.6 and apr-util-1.4.1, using the fastest atomic API:
2) least modules were enabled:
3) MaxRequestWorkers was raised to 800 and ServerLimit to 32.
Nginx was just compiled with its default options:
The common features of Apache and Nginx:
1) Sendfile on.
2) KeepAlive off.
3) AccessLog off.
The configuration files of Apache and Nginx are as followings:
My Ubuntu-10.04 box: