Siege为开源免费测压软件

登陆Siege官网挑选版本http://download.joedog.org/siege/

wget http://download.joedog.org/siege/siege-3.1.0.tar.gz
tar -zxvf siege-3.1.0.tar.gz
cd siege-3.1.0/
./configure
make && make install 
ln -s /usr/local/siege/bin/siege  /usr/bin/siege

使用方法:

-c  200 指定并发数200
-r  5 指定测试的次数5(默认:分钟)+s指定秒数
-f  url.txt 指定url的文件
-i  internet系统,随机发送url
-b  请求无需等待 delay=0
-t  5  持续测试5分钟
#  -r和-t一般不同时使用

-V, --version VERSION, prints the version number.
-h, --help HELP, prints this section.
-C, --config CONFIGURATION, show the current config.
-v, --verbose VERBOSE, prints notification to screen.
-q, --quiet QUIET turns verbose off and suppresses output.
-g, --get GET, pull down HTTP headers and display the

-c, --concurrent=NUM CONCURRENT users, default is 10
-i, --internet INTERNET user simulation, hits URLs randomly.
-b, --benchmark BENCHMARK: no delays between requests.
-t, --time=NUMm TIMED testing where "m" is modifier S, M, or Hex: --time=1H, one hour test.
-r, --reps=NUM REPS, number of times to run the test.
-f, --file=FILE FILE, select a specific URLS FILE.
-R, --rc=FILE RC, specify an siegerc file
-l, --log[=FILE] LOG to FILE. If FILE is not specified, thedefault is used: PREFIX/var/siege.log
-m, --mark="text" MARK, mark the log file with a string.
-d, --delay=NUM Time DELAY, random delay before each requstbetween .001 and NUM. (NOT COUNTED IN STATS)
-H, --header="text" Add a header to request (can be many)
-A, --user-agent="text" Sets User-Agent in request
-T, --content-type="text" Sets Content-Type in request

例:

siege -c 200 -t 1 www.baidu.com
开始为期1分钟  200并发的请求百度

Siege输出结果说明
Transactions: 总共测试次数
Availability: 成功次数百分比
Elapsed time: 总共耗时多少秒
Data transferred: 总共数据传输
Response time: 等到响应耗时
Transaction rate: 平均每秒处理请求数
Throughput: 吞吐率
Concurrency: 最高并发
Successful transactions: 成功的请求数
Failed transactions: 失败的请求数

最后修改:2021 年 09 月 02 日 04 : 19 PM
如果觉得我的文章对你有用,请随意赞赏