linux 安裝ab工具
yum install httpd-tools
用法:
ab -n 請求數 -c 併發數 -p 指定請求數據文件 -T "application/x-www-form-urlencoded" 測試請求地址
注意:
請求測試地址:一般爲from 表單請求地址,不是頁面地址
數據文件:例子:name=123&password=456& (已&結尾)
windwos 下載後,直接到bin目錄 使用cmd運行即可
get請求
abs -n 1 -c 1 “https://blog.csdn.net/”
post請求
abs -n 1 -c 1 -p post.txt -T application/x-www-form-urlencoded “https://blog.csdn.net”
參數解釋
ab:http請求
abs:https請求
-n:測試幾次
-c: 模擬多少客戶端
-T:內容類型。這個一般和-p 一起使用
-p:包含POST參數的文件
參考:https://blog.csdn.net/foreverling_ling/article/details/81667857