Thu, Jan 21st, 2010
cherokee vs nginx @ 压力测试
近日flying殿建议用cherokee来替换掉已经在VPS上运行了一年多的nginx,cherokee内建一个基于Web的管理界面,设置相当方便,不过性能如何还是个未知数,因此用ApacheBench进行了压力测试进行对比。
使用的命令参数如下:
ab -n 1000 -c 50 [URL]
也就是使用50个并发连接,总共创建1000个连接。
cherokee和nginx都运行在我的VMware内的Ubuntu Server中,进程数量均为4,均使用php fastcgi调用php。
下面分别是测试成绩:
首先是cherokee
Server Software: Cherokee/0.99.39
Server Hostname: 192.168.2.129
Server Port: 80
Document Path: /blog/
Document Length: 5938 bytes
Concurrency Level: 50
Time taken for tests: 351.703 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 6175000 bytes
HTML transferred: 5938000 bytes
Requests per second: 2.84 [#/sec] (mean)
Time per request: 17585.156 [ms] (mean)
Time per request: 351.703 [ms] (mean, across all concurrent requests)
Transfer rate: 17.15 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.4 0 16
Processing: 1922 17197 2084.4 17531 18656
Waiting: 1922 17189 2083.5 17531 18656
Total: 1922 17197 2084.5 17531 18656
Percentage of the requests served within a certain time (ms)
50% 17531
66% 17750
75% 17859
80% 17969
90% 18141
95% 18281
98% 18422
99% 18484
100% 18656 (longest request)
然后是nginx
Server Software: nginx/0.7.62
Server Hostname: 192.168.2.129
Server Port: 81
Document Path: /blog/
Document Length: 6004 bytes
Concurrency Level: 50
Time taken for tests: 333.578 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 6231000 bytes
HTML transferred: 6004000 bytes
Requests per second: 3.00 [#/sec] (mean)
Time per request: 16678.906 [ms] (mean)
Time per request: 333.578 [ms] (mean, across all concurrent requests)
Transfer rate: 18.24 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.8 0 16
Processing: 1656 16307 1965.4 16656 17438
Waiting: 1656 16302 1965.4 16656 17422
Total: 1656 16307 1965.5 16656 17438
Percentage of the requests served within a certain time (ms)
50% 16656
66% 16781
75% 16844
80% 16875
90% 17000
95% 17078
98% 17250
99% 17313
100% 17438 (longest request)
可以看到性能方面仍然还是nginx有略微领先(并且不是最新版本——虽然无法判断最新版本的性能是提升还是下降),不过考虑到cherokee的管理界面相当友好,内存占用方面和nginx也不相上下,VPS上的网站的流量也都不大(应该吧? orz),看来近期可以准备动手从nginx迁移过去了~
观赏了…
好久不来,
失去来的习惯了…