ab -n100000 -c600 -H 'Host: httpbin.org' http://192.168.3.22:9001/test_limit > razor-1.0_abtest.out
-n 总请求数
-c 并发请求数
-H 请求头,可使用多次,可重复覆盖
并且将测试报告重定向到文件 razor-1.0_abtest.out
测试报告
Concurrency Level 并发用户(客户端)数,由 -c 指定。
Requests per second 服务器吞吐率,平均每秒处理请求数
Time per request 用户(客户端)平均请求等待时间,等于:Time taken for tests / (Complete requests /Concurrency Level)
Time per request(mean, across all concurrent requests) 服务器平均请求处理时间,等于:Time taken for tests / Complete requests
Percentage of the requests served within a certain time (ms) 用于描述每个请求处理时间的分布情况,比如,在下面测试结果中,50% 请求的处理时间都不超过 289ms,90% 的请求都不超过 3336ms。注意这里的处理时间,是指前面的 Time per request,即对单个用户(客户端)。
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.3.22 (be patient)
Server Software: openresty/1.11.2.2
Server Hostname: 192.168.3.22
Server Port: 9001
Document Path: /test_limit
Document Length: 233 bytes
Concurrency Level: 600
Time taken for tests: 218.767 seconds
Complete requests: 100000
Failed requests: 99937
(Connect: 0, Receive: 0, Length: 99937, Exceptions: 0)
Non-2xx responses: 100000
Total transferred: 16519656 bytes
HTML transferred: 1813545 bytes
Requests per second: 457.11 [#/sec] (mean)
Time per request: 1312.604 [ms] (mean)
Time per request: 2.188 [ms] (mean, across all concurrent requests)
Transfer rate: 73.74 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 72.2 1 3010
Processing: 11 1295 1913.9 289 9323
Waiting: 6 961 1646.4 202 6593
Total: 11 1297 1916.2 289 9485
Percentage of the requests served within a certain time (ms)
50% 289
66% 328
75% 3197
80% 3242
90% 3336
95% 6273
98% 6314
99% 6336
100% 9485 (longest request)
测试命令
ab -n100000 -c600 -H 'Host: httpbin.org' http://192.168.3.22:9001/test_limit > razor-1.0_abtest.out
-n 总请求数 -c 并发请求数 -H 请求头,可使用多次,可重复覆盖
并且将测试报告重定向到文件
razor-1.0_abtest.out
测试报告
-c
指定。Time taken for tests / (Complete requests /Concurrency Level)
Time taken for tests / Complete requests