ab 命令参数很多,只需要使用常用-n(执行请求次数)和-c(每次请求的请求个数)参数即可。
[root@wubolu-centos wubolu]# ab -n 1000 -c 100 http://www.0430.us/df/index.php
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Benchmarking www.0430.us (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
Completed 1000 requests
Finished 1000 requests
Server Software: nginx/0.7.58
Server Hostname: www.0430.us
Server Port: 80
Document Path: /
Document Length: 54514 bytes
Concurrency Level: 100
Time taken for tests: 72.161 seconds #总请求时间
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 54750000 bytes
HTML transferred: 54514000 bytes
Requests per second: 13.86 [#/sec] (mean) #平均每秒的请求数
Time per request: 7216.117 [ms] (mean) #平均每次请求消耗的时间
Time per request: 72.161 [ms] #平均每次请求中每个请求个数消耗的时间
Transfer rate: 740.94 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 15 142 493.5 46 3158
Processing: 849 4629 8717.6 1262 59673
Waiting: 24 129 428.3 44 3656
Total: 874 4771 8783.3 1320 59707
Percentage of the requests served within a certain time (ms)
50% 1320 #就是有50%的请求都是在1320ms内完成的
66% 2246
75% 4270
80% 4566
90% 11259
95% 23123
98% 45445
99% 46058
100% 59707 (longest request)