在線壓力測試工具,方便開發者們快速測試網站或API接口的并發情況、網站性能情況等。
特點:
1)支持多個URL随機模拟場景測試
2)支持設置請求持續時間
3)支持POST + JSON測試
4)支持設置header請求頭
壓力參數說明:
1)并發數:同一時間内發生的請求數量
2)重複次數:這麼說吧,總的請求次數=并發數x重複次數
3)請求時長:壓力測試總時長,單位秒
壓力測試結果說明:
HTTP/1.1 200 0.02 secs: 32417 bytes ==> GET / (每一次請求信息)
HTTP/1.1 200 0.02 secs: 32978 bytes ==> GET /
done.
Transactions: 10 hits(完成多少次處理)
Availability: 100.00 %(成功率%)
Elapsed time: 2.04 secs(總共使用時間secs)
Data transferred: 0.31 MB(總數據傳輸M(不包含頭數據))
Response time: 0.02 secs(平均響應時間secs)
Transaction rate: 4.90 trans/sec(平均每秒完成多少次處理trans/sec)
Throughput: 0.15 MB/sec(平均每秒傳送數據MB/sec)
Concurrency: 0.11(實際最高并發連接數)
Successful transactions: 10(成功處理次數)
Failed transactions: 0(失敗處理次數)
Longest transaction: 0.03(滿足一個請求所需最長時間)
Shortest transaction: 0.02(滿足一個請求所需最短時間)
自建siege壓力測試教程
Linux安裝Siege
如要支持https測試,需要先安裝openssl, 下載地址:https://github.com/openssl/openssl
安裝openssl:
git clone https://github.com/openssl/openssl
cd openssl
./config --prefix=/usr/local/openssl
make
make install
openssl version
安裝siege:
siege下載地址:http://download.joedog.org/siege/siege-latest.tar.gz
tar zxvf siege-4.0.5.tar.gz
cd siege-4.0.5
make clean
./configure --prefix=/usr/local/siege --with-ssl=/usr/local/openssl
make
make install
windows安裝siege
壓力測試工具下載地址:static/file/siege-windows-master.zip
解壓雙層包,一定要保證根目錄是C:\siege-windows,再把根目錄配置成系統的環境變量(windows配置環境變量不用重啟的方法),之後就可以直接使用。
命令參數
參數 描述 -V, –version 打印版本号 -h, –help 打印幫助信息 -C, –config 打印當前配置信息 -g, –get 拉取http頭信息 -p, –print 打印整個頁面的内容 -c, –concurrent=NUM 并發用戶數量,默認10個 -r, –reps=NUM 運行次數 -d, –delay=NUM 随機時間延遲(秒) -b, –benchmark 請求沒有延遲 -i, –internet 模拟網絡用戶随機點擊URL -R, –rc=FILE 指定siegerc文件 -l, –log[=FILE] 日志文件,默認是 PREFIX/var/siege.log -H, –header=”text” 給請求添加頭,支持多個 -A, –user-agent=”text” 給請求設置User-Agent -T, –content-type=”text” 給請求設置Content-Type 使用例子
1.基礎用法
siege -c10 -r3 -p test_url
2.帶Header參數
siege -c10 -r10 -p --header="Authorization: Bearer weli3232r-swet2-834s-fwer-wegwt32r2" --header="token: weuriiower32l2" test_url
3.帶json格式參數
siege -c300 -r10 "test_url POST < params.json"
4.批量url測試(url.txt裡面一個url占一行,多個換行)
siege -c9 -r1 -f url.txt
返回首頁 - 意見反饋 - 關于Kalvin在線工具
-
Copyright © Kalvin在線工具 粵ICP備18152502号
客官可否聽妹一句勸?(~o ̄3 ̄)~請留步!