apache ab

[size=large]ab - Apache HTTP server benchmarking tool

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

【结果分析】

[img]http://dl2.iteye.com/upload/attachment/0097/5159/809ec45f-4570-33ac-8aab-3b85130634cf.jpg[/img]

具体结果分析可以参考[url]http://httpd.apache.org/docs/2.2/programs/ab.html[/url]
几个重点:
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图形化显示
[url]http://blog.csdn.net/fdipzone/article/details/18827069[/url]


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

【参考】
[url]http://www.lubia.me/ab-output-analysis[/url][/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值