?
Apache-ab
URL:https://httpd.apache.org/docs/2.4/programs/ab.html
注:ab工具放在Apache HTTP Server安裝包的bin目錄下,所以要先安裝Apache HTTP Server(以Windows系統為例)。
到Apache HTTP Server官網下載頁面(點擊鏈接),目前最新的版本不提供Windows系統下的安裝包,所以用第三方的安裝包。
ab型usb連接線、?
安裝步驟:
?
1、點擊:http://httpd.apache.org/download.cgi#apache24
2、點擊:Files for Microsoft Windows,再點擊:ApacheHaus
AB接口。
3、選擇自己的對應的版本下載;
4、選擇自己的路徑解壓,找到bin目錄,在cmd.exe執行ab
?
使用:
性能測試需要掌握哪些。ab [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -f protocol ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [ -s timeout ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [ -x -attributes ] [ -X proxy[:port] ] [ -y -attributes ] [ -z-attributes ] [ -Z ciphersuite ] [http[s]://]hostname[:port]/path
常用參數說明:
-n ? ?請求的總數,默認是1次。
-c ? ?并發數,同一時間請求數。
-p ? ?如果后面接的是文件,表示POST請求,文件中包含請求數據,根據數據格式,設置-T參數。
-T ? ?設置請求頭中的Content-type(針對POST/PUT),比如:application/x-www-form-urlencoded。默認是text/plain。
AB接口是什么意思。-w ? ?將測試結果打印到HTML表格中。
?
鍵入命令:?
ab -n 10 -c 10 URL
(-n發出10個請求,-c模擬10并發,相當10人同時訪問,后面是測試url)
ab -t 1 -c 100 URL
在1秒內發請求,一次100個請求。?
注:輸入報錯,不支持ab的用abs