$ sudo apt install siege
- Siege Command Common parameters
-c 200 指定并发数200-r 5 指定测试的次数5-f urls.txt 制定url的文件-i internet系统,随机发送url-b 请求无需等待 delay=0-t 5 持续测试5分钟# -r和-t一般不同时使用
- Several commonly used sub-
# 模拟10秒内每秒访问20次$ sudo siege http://web.meilapp.com/products -c20 -t10s# 200个并发对http://www.google.com发送请求100次$ siege -c 200 -r 100 http://www.google.com# 在urls.txt中列出所有的网址$ siege -c 200 -r 100 -f urls.txt# 随机选取urls.txt中列出所有的网址$ siege -c 200 -r 100 -f urls.txt -i# delay=0,更准确的压力测试,而不是功能测试$ siege -c 200 -r 100 -f urls.txt -i -b# 指定http请求头 文档类型siege -H "Content-Type:application/json" -c 200 -r 100 -f urls.txt -i -b
- Siege output Result Description
** SIEGE 3.0.8** Preparing 20 concurrent users for battle.The server is now under siege...Lifting the server siege... done.Transactions: 2 hits # 总共测试次数Availability: 100.00 % # 成功次数百分比Elapsed time: 9.02 secs # 总共耗时多少秒Data transferred: 0.01 MB # 总共数据传输Response time: 2.73 secs # 等到响应耗时Transaction rate: 0.22 trans/sec # 平均每秒处理请求数Throughput: 0.00 MB/sec # 吞吐率Concurrency: 0.61 # 最高并发Successful transactions: 9 # 成功的请求数Failed transactions: 0 # 失败的请求数Longest transaction: 5.40Shortest transaction: 0.00
Ubuntu Siege Stress Test Tool