I used ab (ab -c50 -t5s) to benchmark Apache V Nginx for a static file on the same server.
Apache becomes CPU bound at 200 requests per second and Nginx is at about 25% CPU while handline 5211 requests per second.
No swapping took place with Apache, lack of memory wasn't an issue.
I know there are a myriad of different configurations for both Nginx and Apache, but how far behind Apache is Nginx is just ridiculous.
So ridiculous in fact that I think I've missed something with Apache.
Any ideas where to start?
Here are the ab results:
Server Software: nginx
Server Port: 80
Document Path: /images/15.jpg
Document Length: 15088 bytes
Concurrency Level: 50
Time taken for tests: 5.494 seconds
Complete requests: 26059
Failed requests: 0
Write errors: 0
Total transferred: 400370476 bytes
HTML transferred: 393178192 bytes
Requests per second: 5211.29 [#/sec] (mean)
Time per request: 9.595 [ms] (mean)
Time per request: 0.192 [ms] (mean, across all concurrent requests)
Transfer rate: 78189.48 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 0.6 4 10
Processing: 3 5 0.8 5 13
Waiting: 0 2 1.3 2 10
Total: 6 9 0.9 9 19
Percentage of the requests served within a certain time (ms)
50% 9
66% 9
75% 9
80% 9
90% 10
95% 10
98% 11
99% 12
100% 19 (longest request)
Server Software: Apache
Server Port: 81
Document Path: /images/15.jpg
Document Length: 15088 bytes
Concurrency Level: 50
Time taken for tests: 5.31551 seconds
Complete requests: 1008
Failed requests: 0
Write errors: 0
Total transferred: 15681815 bytes
HTML transferred: 15433585 bytes
Requests per second: 200.34 [#/sec] (mean)
Time per request: 249.581 [ms] (mean)
Time per request: 4.992 [ms] (mean, across all concurrent requests)
Transfer rate: 3043.59 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 2 84 47.5 78 222
Processing: 24 158 46.5 162 260
Waiting: 1 96 45.1 91 221
Total: 187 242 48.5 232 428
Percentage of the requests served within a certain time (ms)
50% 232
66% 238
75% 246
80% 249
90% 304
95% 380
98% 409
99% 423
100% 428 (longest request)
This post is now defunct.
I discovered that this is NOT a standard Apache setup and the extended mod_security rules is the issue.