Site icon moneyslow.com

https的压力测试工具siege用法

https的压力测试工具siege用法

jeo dog 是个有10多年历史的软件站,有个https的工具siege很厉害,几乎国内没有使用的,今天介绍给大家。

先下载安装:

wget http://download.joedog.org/siege/siege-3.0.5.tar.gz
tar -xzvf siege-3.0.5.tar.gz
cd siege-3.0.5
./configure --prefix=/home/2hei.net/siege --with-ssl=/usr/include/openssl
make && make install

运行测试,模拟1000用户打压5分钟:
/home/2hei.net/siege/bin/siege -c 1000 -t 5m https://xxx.com
结果:
Lifting the server siege... done.

Transactions: 376673 hits
Availability: 99.98 %
Elapsed time: 299.70 secs
Data transferred: 114.59 MB
Response time: 0.29 secs
Transaction rate: 1256.83 trans/sec
Throughput: 0.38 MB/sec
Concurrency: 364.41
Successful transactions: 376674
Failed transactions: 91
Longest transaction: 28.97
Shortest transaction: 0.00

FILE: /home/2hei.net/siege/var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.
[error] unable to create log file: No such file or directory

成功率99.9%,还可以,最后的报错是因为没有指定记录日志,不需要的话可以不用管它。

几个需要注意到的参数:

-i  随机 URL ,默认是从列表的上面到下面来打压力
-b 进行压力测试,不进行延时

-t  持续时间,即测试持续时间,在NUM时间后结束,单位默认为分

siege -c 200 -r 150 -f /root/4k.list  -i -b

200个用户,重复150次,利用4k.list 文件中的url,-i是随机,-b 不延时。

Exit mobile version