stress

原创
2016/06/24 18:17
阅读数 949

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
展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部