Po meni, Apache je odsvirao svoje... nginx nije uopšte komplikovan za konfiguraciju, pogotovo što za svaku moguću kombinaciju postoji rešenje na netu. Dobici u odnosu na Apache su neverovatni i zaista ne znam zašto bi bilo ko dao Apache-u šansu. Pa čak i glupi Tomcat (pisan u Javi) gazi Apache u servovanju statičkog sadržaja!
Evo malo primera (ista mašina, isti file):
Tomcat:
Code:
# ab -c 100 -n 10000 http://localhost:8080/manager/images/tomcat.gif
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /manager/images/tomcat.gif
Document Length: 1934 bytes
Concurrency Level: 100
Time taken for tests: 0.903668 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 21810000 bytes
HTML transferred: 19340000 bytes
Requests per second: 11066.01 [#/sec] (mean)
Time per request: 9.037 [ms] (mean)
Time per request: 0.090 [ms] (mean, across all concurrent requests)
Transfer rate: 23568.39 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 4
Processing: 1 8 0.8 8 9
Waiting: 1 8 0.7 8 9
Total: 1 8 0.8 8 11
Percentage of the requests served within a certain time (ms)
50% 8
66% 9
75% 9
80% 9
90% 9
95% 9
98% 9
99% 9
100% 11 (longest request)
Apache:
Code:
# ab -c 100 -n 10000 http://localhost/tomcat.gif
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /tomcat.gif
Document Length: 1934 bytes
Concurrency Level: 100
Time taken for tests: 1.164571 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 21898756 bytes
HTML transferred: 19347736 bytes
Requests per second: 8586.85 [#/sec] (mean)
Time per request: 11.646 [ms] (mean)
Time per request: 0.116 [ms] (mean, across all concurrent requests)
Transfer rate: 18362.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.7 0 6
Processing: 2 10 1.8 10 18
Waiting: 1 9 1.6 9 17
Total: 2 11 1.9 11 19
Percentage of the requests served within a certain time (ms)
50% 11
66% 11
75% 12
80% 13
90% 14
95% 14
98% 15
99% 16
100% 19 (longest request)
nginx nemam na toj mašini ali mislim i da je ovo dovoljno. Java server brži od servera pisanog u C-u... Ej!