1 指定速率进行压力测试:
-rate 参数可以指定每秒发送多少个请求
-duration 参数指定持续时间,用来构造一次恒定速率的测试
2 指定并发数进行压力测试:
-c 表示并发数
-n 指定请求数
3 POST数据:
POST http://127.0.0.1:4869/ password.txt
4 多核支持:
stress -cpus=4
5 report工具:
stress report -input=result.json,result2.json,result3.json -output=output.json -reporter=json
6 测试url:
http://192.168.1.1/api/get_data
echo "POST http://192.168.1.1/api/get_data post_8k" | ./stress -cpus=4 attack -rate=1000 -duration=5s |tee results.bin | ./stress report
echo "POST http://192.168.1.1/api/get_data" | ./stress -cpus=4 attack -body="post_3000" -rate=300 -duration=300s -output="result.json"
7 50个用户 重复100次 发送POST参数(从文件中读取)
/usr/local/siege/bin/siege -c 50 -r 100 https://192.168.1.1/api/get_data POST < /root/ab_test/post.xml