Lighttpd和Nginx 性能测试 处理静态文件和图片文件测试
本次测试都采用正式发行版 服务器内存为1gb 使用ApacheBench
安装编译 都一样
./configure
make
make install
lighttpd -f /etc/lighttpd/lighttpd.conf
And for Nginx:
/usr/local/nginx/sbin/nginx
Two files were used for testing purposes:
- index.html (356 bytes)
- test.png (313 kilobytes)
Each file was accessed 100,000 times. For index.html concurrency was set to 1000, and 10 for test.png. Keepalive was not used.
测试结果
index.html:
Nginx | Lighttpd | |
---|---|---|
Concurrency Level: | 1000 | 1000 |
Time taken for tests (seconds): | 12.445774 | 10.951389 |
Complete requests: | 100000 | 100000 |
Failed requests: | 0 | 0 |
Write errors: | 0 | 0 |
Total transferred (bytes): | 56779947 | 62353634 |
HTML transferred (bytes): | 35650196 | 35687932 |
Requests per second [#/sec] (mean): | 8034.86 | 9131.26 |
Time per request [ms] (mean) : | 124.458 | 109.514 |
Time per request [ms] (mean, across all concurrent requests): | 0.124 | 0.110 |
Transfer rate [Kbytes/sec] received : | 4455.25 | 5560.21 |
test.png
Nginx | Lighttpd | |
---|---|---|
Concurrency Level: | 10 | 10 |
Time taken for tests (seconds): | 52.889986 | 54.976213 |
Complete requests: | 100000 | 100000 |
Failed requests: | 0 | 0 |
Write errors: | 0 | 0 |
Total transferred (bytes): | 32067859584 | 32070273152 |
HTML transferred (bytes): | 32046457872 | 32045670938 |
Requests per second [#/sec] (mean): | 1890.72 | 1818.97 |
Time per request [ms] (mean) : | 5.289 | 5.498 |
Time per request [ms] (mean, across all concurrent requests): | 0.529 | 0.550 |
Transfer rate [Kbytes/sec] received : | 592102.06 | 569675.94 |
Conclusion
Both servers performed extremely well, though it seems that Lighttpd might perform best in a more fragmented file system (smaller files). Nginx performed better serving test.png, but the difference is smaller than the preceeding test.
Considering that each would easily saturate the pipeline I doubt a real-world performance difference would be seen.
Very Interesting post! Thank you for such interesting resource!PS: Sorry for my bad english, I’v just started to learn this language
I love her blog too!!! She has amazing clothes!! And I want her hair !!!
blog.cnlabs.net – cool!!!!
I rarely comment on blogs but yours I had to stop and say Great Blog!!