https://www.joedog.org/

yum install -y siege

[root@wow ~]# siege –help
New configuration template added to /root/.siege
Run siege -C to view the current settings in that file
SIEGE 4.0.2
Usage: siege [options]
siege [options] URL
siege -g URL
Options:
-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
transaction. Great for application debugging.
-c, –concurrent=NUM CONCURRENT users, default is 10
-r, –reps=NUM REPS, number of times to run the test.
-t, –time=NUMm TIMED testing where “m” is modifier S, M, or H
ex: –time=1H, one hour test.
-d, –delay=NUM Time DELAY, random delay before each requst
-b, –benchmark BENCHMARK: no delays between requests.
-i, –internet INTERNET user simulation, hits URLs randomly.
-f, –file=FILE FILE, select a specific URLS FILE.默认为urls.txt,位于siege 安装目录下的etc/urls.txt
-R, –rc=FILE RC, specify an siegerc file
-l, –log[=FILE] LOG to FILE. If FILE is not specified, the
default is used: PREFIX/var/siege.log
-m, –mark=”text” MARK, mark the log file with a string.
between .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

Copyright (C) 2016 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

Siege命令常用参数
-c 200 指定并发数200
-r 5 指定测试的次数5
-f urls.txt 制定url的文件
-i internet系统,随机发送url
-b 请求无需等待 delay=0
-t 5 持续测试5分钟
# -r和-t一般不同时使用

如果url中含有空格和中文,要先进行url编码,否则siege发送的请求url不准确
siege -r 100 -c 10 http://www.baidu.com
-r 是 repeat , -r 100是重复100次测试
-c 10是表示模拟10个用户同时并发连接
发送post请求时,url格式为:http://www.xxxx.com/ POST p1=v1&p2=v2
siege “http://118.212.149.xx:8080/xx/xx/xx POST {\”accountId\”:\”123\”,\”platform\”:\”ios\”}” -r 10 -c 200

Lifting the server siege…
Transactions: 3465 hits
Availability: 100.00 %
Elapsed time: 84.84 secs
Data transferred: 248.98 MB
Response time: 0.21 secs
Transaction rate: 40.84 trans/sec
Throughput: 2.93 MB/sec
Concurrency: 8.67
Successful transactions: 3466
Failed transactions: 0
Longest transaction: 1.17
Shortest transaction: 0.07

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code