怎样用apache bench压测工具POST的GET来压测且定义header及json
更新:HHH   时间:2023-1-7


本篇文章为大家展示了怎样用apache bench压测工具POST的GET来压测且定义header及json,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

要求时间的单curl测试的方式如下:

time curl http://xxxxx/hq/restapi/isStart

curl用来用post请求,且有header及请求内容

time curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d63xxx-xxxx-xxxxf450" -d '{"lsock":[{"akcolde":"600000","marketType":"BB"}]}' "http://xxxxxx/hq/restapi/ime"

用ab来作吧。

ab -n 100000 -c 500 http://xxx/hq/restapi/isdrt
ab -n 10000 -c 100  -p "post.txt" -T "application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d6xxs-sdf-sdf09d" "http://cnxxx81/hq/restapi/queryRealTime"

post.txt

{"lstStock":[{"sterode":"600000","madfpe":"SH"}]}

上述内容就是怎样用apache bench压测工具POST的GET来压测且定义header及json,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注天达云行业资讯频道。

返回大数据教程...