在目标服务器上执行
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 testab -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的错误,就当正常完成的吧。