Im very confused right now...
I've always used Nginx to serve up static files and pass off php to Apache. I built a new box 4GB Ram, installed Apache 2.4.7 with mpm_prefork module and NginX 1.4.6. I setup what I needed to and decided to run some ab tests. I was shocked at what I saw. In every ab test Apache did just about as well as NginX.
Is this right for Apache 2.4? I've read about the performance upgrades with 2.4, however in the past NginX would destroy Apache. Am I missing something?
Apache:
Concurrency Level: 100
Time taken for tests: 1.157 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 279000 bytes
HTML transferred: 21000 bytes
Requests per second: 864.65 [#/sec] (mean)
Time per request: 115.654 [ms] (mean)
Time per request: 1.157 [ms] (mean, across all concurrent requests)
Transfer rate: 235.58 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 32 11.3 27 236
Processing: 27 78 15.6 77 380
Waiting: 26 78 15.6 77 379
Total: 55 109 21.1 104 404
Percentage of the requests served within a certain time (ms)
50% 104
66% 116
75% 121
80% 123
90% 129
95% 135
98% 162
99% 173
100% 404 (longest request)
NginX:
Concurrency Level: 100
Time taken for tests: 1.026 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 362000 bytes
HTML transferred: 21000 bytes
Requests per second: 975.00 [#/sec] (mean)
Time per request: 102.564 [ms] (mean)
Time per request: 1.026 [ms] (mean, across all concurrent requests)
Transfer rate: 344.68 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 33 14.4 29 223
Processing: 24 34 39.2 28 664
Waiting: 24 34 39.2 28 664
Total: 50 67 42.2 57 691
Percentage of the requests served within a certain time (ms)
50% 57
66% 72
75% 76
80% 77
90% 80
95% 86
98% 97
99% 240
100% 691 (longest request)
This is consistent across all my tests. This test has the biggest performance gap of all my test. Normally Apache is coming in about 5%-10% less in raw requests/sec of NginX.
If Apache 2.4 is in fact close to NginX then I don't see any point in setting up a reverse proxy and all the other complexity that comes with it.
Thoughts?