- 论坛徽章:
- 0
|
测试记录:
目的:通过工具webbench模拟客户端并发请求,比较nginx ,apache二者处理性能。
过程:
场景1:选择并发数为 200 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 200 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
200 clients, running 120 sec.
Speed=113997 pages/min, 9184316 bytes/sec.
Requests: 227994 susceed, 0 failed. webbench -c 200 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
200 clients, running 120 sec.
Speed=114036 pages/min, 9306628 bytes/sec.
Requests: 228073 susceed, 0 failed
场景2:选择并发数为 500 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 500 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
500 clients, running 120 sec.
Speed=114019 pages/min, 9252143 bytes/sec.
Requests: 228039 susceed, 0 failed. webbench -c 500 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
500 clients, running 120 sec.
Speed=114003 pages/min, 9271878 bytes/sec.
Requests: 228007 susceed, 0 failed.
场景3:选择并发数为 1000 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 1000 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
1000 clients, running 120 sec.
Speed=113949 pages/min, 9234659 bytes/sec.
Requests: 227899 susceed, 0 failed. webbench -c 1000 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
1000 clients, running 120 sec.
Speed=114048 pages/min, 9317674 bytes/sec.
Requests: 228096 susceed, 0 failed.
场景4:选择并发数为 2000 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 2000 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
2000 clients, running 120 sec.
Speed=113800 pages/min, 9225763 bytes/sec.
Requests: 227600 susceed, 0 failed. webbench -c 2000 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
2000 clients, running 120 sec.
Speed=114086 pages/min, 9347989 bytes/sec.
Requests: 228173 susceed, 0 failed.
场景5:选择并发数为 3000 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 3000 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
3000 clients, running 120 sec.
Speed=113729 pages/min, 9297602 bytes/sec.
Requests: 227459 susceed, 0 failed. webbench -c 3000 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
3000 clients, running 120 sec.
Speed=114284 pages/min, 9508443 bytes/sec.
Requests: 228489 susceed, 80 failed.
场景6:选择并发数为 5000 ,时间为 120s 分别对nginx ,apache并发请求。
nginx apache
webbench -c 5000 -t 120 http://172.20.1.137/
Benchmarking: GET http://172.20.1.137/
5000 clients, running 120 sec.
Speed=113380 pages/min, 9338037 bytes/sec.
Requests: 226760 susceed, 0 failed. webbench -c 5000 -t 120 http://172.20.1.136/
Benchmarking: GET http://172.20.1.136/
5000 clients, running 120 sec.
Speed=114477 pages/min, 9746262 bytes/sec.
Requests: 228950 susceed, 4 failed.
结论:根据6组测试可以得知 apache 在3000并发请求以上存在失败数,而nginx仍然可以处理并发数,由此可知就并发处理能力上而言nginx优越于apache。 |
|