Apache的测试工具ab(ApacheBench)源码分析
转自http://www.cnblogs.com/PursuitOnly/archive/2013/02/07/2908591.html先看看ab总的流程图有个总体印象。
第二步ab简介
采用 apache 版本为:apache-‐2.2.22
使用:
在 ubuntu 系统下:
./ab -n 1000 -c 50 -p post.txt http://127.0.0.1:9090/query 发送 1000 个请求,每次发 50 个,post 的内容在post.txt 里。
提要:
ab [ -A auth-username:password ] [ -b windowsize ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ][ -ecsv-file] [-fprotocol][-ggnuplot-file][-h][-Hcustom-header][-i][-k][-nrequests][-pPOST-file] [-Pproxy-auth-username:password][-q][-r][-s][-S][-ttimelimit][-Tcontent-type][-uPUT-file] [-vverbosity][-V][-w][-x-attributes ][-Xproxy[:port]][-y-attributes][-z-attributes][-Zciphersuite] ://]hostname[:port]/path
注:红色部分是不可缺少部分。
还可以修改源码添加需要的option。比如添加-D参数输出结果
比如在终端输入命令: ./ab–D2-n1000-c100-ppostdata.txt 10.200.34.41/
第三步: ab源码分析
页:
[1]