ab测试时报 apr_socket_recv: Connection timed out (110)

原创
2018/11/23 19:04
阅读数 1.2K

在目标服务器上执行

ulimit -n 999999

其他常规的服务器参数优化参考这 参考

ab发送post数据的方法

# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test

ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/

详细参考

ab对于测试动态输出的内容判断是否成功上一直有个BUG,会将动态长度内容返回当作失败Failed requests请求来计算,查看统计报表时只要不是Connect或Exception的错误,就当正常完成的吧。

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部