wget http://download.joedog.org/siege/siege-latest.tar.gz
tar -zxvf siege-latest.tar.gz cd siege-*/
sudo apt-get install build-essential
./configure make sudo make install
siege.config
logfile = $(HOME)/siege.log
打開siege -h看是否安裝成功,打開siege -h能夠看到siege的有關參數
ubuntu
頁面URL:http://ur.tencent.com/categories/7 http://ur.tencent.com/categories/7/?page=2 http://ur.tencent.com/categories/7/?page=3
在虛擬機ubuntu訪問上面三條鏈接,併發數是5,持續運行1分鐘服務器
magicianyin@ubuntu:~/test$ siege -c 5 -t 1M -f url.txt Lifting the server siege... done. Transactions: 345 hits Availability: 100.00 % Elapsed time: 59.73 secs Data transferred: 1.88 MB Response time: 0.36 secs Transaction rate: 5.78 trans/sec Throughput: 0.03 MB/sec Concurrency: 2.10 Successful transactions: 345 Failed transactions: 0 Longest transaction: 27.16 Shortest transaction: 0.21
magicianyin@ubuntu:~/test$ siege -c 5 -t 1M -f url.txt --log=result.csv magicianyin@ubuntu:~/test$ more result.csv Date & Time, Trans, Elap Time, Data Trans, Resp Time, Trans Rate, Throughput, Concurrent, OKAY, Failed 2018-02-07 04:10:10, 160, 59.30, 0, 0.35, 2.70, 0.00, 0.95, 160, 4
magicianyin@ubuntu:~/test$ siege -c 5 -t 1M -f url.txt -H "Accept-Encoding:gzip" --log=result_gzip.csv magicianyin@ubuntu:~/test$ more result_gzip.csv Date & Time, Trans, Elap Time, Data Trans, Resp Time, Trans Rate, Throughput, Concurrent, OKAY, Failed 2018-02-07 04:22:44, 197, 59.83, 1, 0.35, 3.29, 0.02, 1.14, 197, 3
magicianyin@ubuntu:~/test$ siege -c 1 -r 1 -A "Apple-iPhone5C2/1001.525" http://www.baidu.com Transactions: 1 hits Availability: 100.00 % Elapsed time: 0.09 secs Data transferred: 0.00 MB Response time: 0.08 secs Transaction rate: 11.11 trans/sec Throughput: 0.01 MB/sec Concurrency: 0.89 Successful transactions: 1 Failed transactions: 0 Longest transaction: 0.08 Shortest transaction: 0.08