`

apache ab

阅读更多
ab - Apache HTTP server benchmarking tool

【基本用法】
ab参数详解:http://httpd.apache.org/docs/2.2/programs/ab.html
ab -n1000 -c10 url
例如:./ab  -n1000 -c20 http://ip/xx

【结果分析】



具体结果分析可以参考http://httpd.apache.org/docs/2.2/programs/ab.html
几个重点:
Concurrency Level: The number of concurrent clients used during the test 并发数
Time taken for tests: This is the time taken from the moment the first socket connection is created to the moment the last response is recieved 第一个连接到最后一个响应时间(总运行时间)
Complete requests:The number of successful responses recieved 请求数
Requests per second:This is the number of requests per second. This value is the result of dividing the number of requests by the total time taken 每秒处理的请求数
Time per request:The average time spent per request. The first value is calculated with the formula concurrency * timetaken * 1000 / done while the second value is calculated with the formula timetaken * 1000 / done 每个请求的平均时间(第一个值乘以线程数,第二个不乘以线程数)

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       6
Processing:     2   20  39.3     16     696
Waiting:        2   19  36.9     15     696
Total:          2   20  39.3     16     697
每一项分别有min(最小值),mean(平均值),[+/-sd](方差),median(中位数),max(最大值)
Connect :socket链路建立消耗,代表网络状况好坏
Processing :写入缓冲区消耗+链路消耗+服务端消耗
Waiting :写入缓冲区消耗+链路消耗+服务端消耗+读取数据消耗
Total :单个事务总时间


【图形化显示】
内容输出到文件,gnuplot读取文件生成图片
eg:ab -n 500 -c 100 -g ./ab_500_100.dat http://localhost/index.php 
ab测试结果gunplot图形化显示
http://blog.csdn.net/fdipzone/article/details/18827069


【源码】
源码地址:http://svn.apache.org/repos/asf/httpd/httpd/trunk/support/ab.c

【参考】
http://www.lubia.me/ab-output-analysis
  • 大小: 162.5 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics