轉自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 ]
[ -e
csv-file ] [ -f protocol ] [ -g gnuplot-file ]
[ -h ] [ -H custom-header ] [ -i ] [ -k ] [
-n requests ] [ -p POST-file ]
[ -P proxy-auth-username:password ] [ -q ] [ -r ] [
-s ] [ -S ] [ -t timelimit ] [ -T content-type
] [ -u PUT-file ] [ -v
verbosity] [ -V ] [ -w ] [ -x <table>-attributes
] [ -X proxy[:port] ] [ -y <tr>-attributes ]
[ -z <td>-attributes ] [ -Z
ciphersuite ] [http[s]://]hostname[:port]/path
注:紅色部分是不可缺少部分。
還可以修改源碼添加需要的option。比如添加-D參數輸出結果
比如在終端輸入命令: ./ab –D 2 -n 1000 -c 100 -p postdata.txt 10.200.34.41/
第三步: ab源碼分析