红联Linux门户
Linux帮助

Linux下Web压力测试工具Siege的使用

发布时间:2015-03-30 21:57:28来源:linux网站作者:gccmx

Linux下得Web压力测试工具,最常用的应该就是apache的ab了,当然可供选择的有很多。webbench,http_load。看你个人爱好了。不过,最近,用的最顺手的是siege。

siege官网地址http://www.joedog.org/

最新版本3.0.8,下载地址http://download.joedog.org/siege/


1、安装

wget http://download.joedog.org/siege/siege-3.0.8.tar.gz

tar xzvf siege-3.0.8.tar.gz

cd siege-3.0.8

./configure

make && make install


2、准备测试url或者url列表文件


3、跑起

siege www.linux.com/test.php -b -r10 -c400

参数说明:

-b --benchmark          BENCHMARK: no delays between requests.

每次request之间没有延迟,还有一个-d参数加上延迟,类似于一些专业测试工具的思考时间

-r  --reps=NUM            REPS, number of times to run the test.

每次请求执行多少次

-c  --concurrent=NUM      CONCURRENT users, default is 10

并发用户

-f  --file=FILE          FILE, select a specific URLS FILE.


4、执行结果

Transactions:                3915 hits
Availability:              97.88 %
Elapsed time:              43.73 secs
Data transferred:          706.12 MB
Response time:                2.90 secs
Transaction rate:          89.53 trans/sec
Throughput:              16.15 MB/sec
Concurrency:              259.48
Successful transactions:        3915
Failed transactions:              85
Longest transaction:          37.70
Shortest transaction:            0.05