Apache versus lighttpd

Both run on the same server: Apache/2.0.59 (port 80) & lighttpd 1.4.19 (port 8080). 2 tests: dynamic & static files. To make things a little realistic, it’s from a EU client to a US server.

Serving a dynamic file

eu$ ab -n 1000 -c 10 “http://us.server/run-some-sql.php”

Server Software:        Apache
Server Port:            80
Document Length:        824 bytes
Time taken for tests:   36.51463 seconds
Total transferred:      1213118 bytes
HTML transferred:       847886 bytes
Requests per second:    27.74 [#/sec] (mean)
Time per request:       360.515 [ms] (mean)
Time per request:       36.051 [ms] (mean, across all concurrent requests)
Transfer rate:          32.84 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      158  158   0.3    158     162
Processing:   174  200  26.4    191     340
Waiting:      173  199  26.3    191     340
Total:        332  358  26.4    349     498
Server Software:        lighttpd/1.4.19
Server Port:            8080
Document Length:        921 bytes
Time taken for tests:   35.406200 seconds
Total transferred:      1202655 bytes
HTML transferred:       857071 bytes
Requests per second:    28.24 [#/sec] (mean)
Time per request:       354.062 [ms] (mean)
Time per request:       35.406 [ms] (mean, across all concurrent requests)
Transfer rate:          33.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      158  158   0.6    158     167
Processing:   172  193  29.0    183     383
Waiting:      172  192  29.0    183     383
Total:        330  351  29.1    341     541

Apache: 27.74 requests/sec
Lighttpd 28.24 requests/sec

Serving a static file

eu$ ab -n 1000 -c 10 “http://us.server/img/some-image.gif”

Server Software:        Apache
Server Port:            80
Document Length:        14781 bytes
Time taken for tests:   63.858434 seconds
Total transferred:      15060000 bytes
HTML transferred:       14781000 bytes
Requests per second:    15.66 [#/sec] (mean)
Time per request:       638.584 [ms] (mean)
Time per request:       63.858 [ms] (mean, across all concurrent requests)
Transfer rate:          230.31 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      157  158   0.5    158     164
Processing:   476  478   4.6    478     549
Waiting:      158  159   4.0    159     228
Total:        634  636   4.6    636     707
Server Software:        lighttp/1.4.19
Server Port:            8080
Document Length:        14781 bytes
Time taken for tests:   63.736261 seconds
Total transferred:      14992000 bytes
HTML transferred:       14781000 bytes
Requests per second:    15.69 [#/sec] (mean)
Time per request:       637.363 [ms] (mean)
Time per request:       63.736 [ms] (mean, across all concurrent requests)
Transfer rate:          229.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      157  158   0.4    158     160
Processing:   476  478   2.2    478     491
Waiting:      158  158   1.5    159     166
Total:        634  636   2.3    636     649

Apache 15.66 requests/sec
Lighttpd 15.69 requests/sec

Apache is very decent when there is a low concurrency level (about 10-20). When taken into account the stability, features, modules, it’s an excellent choice. Lighttpd under high load although can perform very well, it does suffer from an issue with PHP (current with 1.4.19 and 5.1.6), its backend fast-cgi became overloaded and gave out 500 errors to clients. Bad lighty, or bad PHP! Hope they got it fixed in 1.5 or some future version of PHP


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *