最近研究了一下压力测试网站工具(ab、webbench),但是不知道测试nginx时为什么会有失败的请求?望路过的高手指点指点!
服务器A:apache+resin
服务器B:nginx+resin
为了比较nginx和apache的并发,采用上面两种工具测试!下面是测试结果!
服务器A的ab测试结果( ab测试):
[root@localhost ~]# ab -c 1000 -n 1000
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
Copyright (c) 1998-2002 The Apache Software Foundation,
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: Apache/2.2.11
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /idecl/index.jsp
Document Length: 2733 bytes
Concurrency Level: 1000
Time taken for tests: 3.278260 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 2981880 bytes
HTML transferred: 2743932 bytes
Requests per second: 305.04 [#/sec] (mean)
Time per request: 3278.260 [ms] (mean)
Time per request: 3.278 [ms] (mean, across all concurrent requests)
Transfer rate: 887.97 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 31 57.4 2 170
Processing: 47 664 320.1 628 2991
Waiting: 46 656 318.3 622 2988
Total: 205 695 317.5 650 3094
Percentage of the requests served within a certain time (ms)
50% 650
66% 738
75% 832
80% 880
90% 1040
95% 1240
98% 1470
99% 1811
100% 3094 (longest request)
服务器B的测试结果(ab测试):
[root@hadoop3 ~]# ab -c 1000 -n 1000
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
Copyright (c) 1998-2002 The Apache Software Foundation,
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: nginx/1.3.5
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /idecl/index.jsp
Document Length: 192 bytes
Concurrency Level: 1000
Time taken for tests: 0.268302 seconds
Complete requests: 1000
Failed requests: 229
(Connect: 0, Length: 229, Exceptions: 0)
Write errors: 0
Non-2xx responses: 772
Total transferred: 959986 bytes
HTML transferred: 776814 bytes
Requests per second: 3727.14 [#/sec] (mean)
Time per request: 268.302 [ms] (mean)
Time per request: 0.268 [ms] (mean, across all concurrent requests)
Transfer rate: 3492.33 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 23 8.0 26 32
Processing: 20 59 34.6 55 223
Waiting: 16 57 35.2 53 222
Total: 47 83 32.4 76 248
Percentage of the requests served within a certain time (ms)
50% 76
66% 85
75% 93
80% 98
90% 139
95% 157
98% 171
99% 179
100% 248 (longest request)
服务器A测试结果(webbench测试):
[root@localhost ~]# webbench -c 1000 -t 30
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET
1000 clients, running 30 sec.
Speed=13326 pages/min, 656102 bytes/sec.
Requests: 6663 susceed, 0 failed.
服务器B测试结果(webbench测试):
[root@hadoop3 ~]# webbench -c 1000 -t 30
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET
1000 clients, running 30 sec.
Speed=82852 pages/min, 4116163 bytes/sec.
Requests: 41420 susceed, 6 failed.
阅读(2372) | 评论(1) | 转发(0) |