2018年12月19日 星期三

壓力測試 siege

環境: AWS的centos

安裝檔: http://download.joedog.org/siege/

先下載
wget http://download.joedog.org/siege/siege-4.0.4.tar.gz
tar -zvxf siege-4.0.4.tar.gz

安裝
sudo ./configure
sudo make
sudo make install


使用siege -h查看可用參數

壓測指令範例
siege -c 100 -t 1  -f list.txt -i -b > siege.log
c: 使用者數
t: 執行時間,單位分鐘
f: 要攻擊的網址清單
i: 隨機取網址
b: 不延遲

執行完畢後會把結果顯示出來,這就可以拿來做報告的數據。
Transactions: 30 hits ## 完成的要求數 Availability: 100.00 % ## 可用,成功率100% Elapsed time: 10.67 secs ## 運作時間 Data transferred: 3.07 MB ## 數據傳輸量 Response time: 0.50 secs ## 回應時間 Transaction rate: 6.42 trans/sec ## 每秒完成幾個請求 Throughput: 0.01 MB/sec ## 吞吐量 Concurrency: 3.21 ## 最高連接數 Successful transactions: 30 ## 成功完成次數 Failed transactions: 0 ## 失敗次數 Longest transaction: 1.25 ## 每次傳輸最常時間 Shortest transaction: 0.55 ## 每次傳輸最短時間