limit_conn_zone限定IP最大连接数:
limit_req_zone限定IP最大请求数:
ab -n 全部请求数 -c 并发数 测试 url
ab -n 100 -c 10 http://m.xxxx.com/
-r Don‘t exit on socket receive errors. # 在遇到socket接收错误后,不退出测试
-s timeout Seconds to max. wait for each response # 最大超时时间,默认30s
Default is 30 seconds
-k Use HTTP KeepAlive feature # keep-alive保持连接
参考:
限制请求速率:http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
http请求限制:http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html
stream转发请求限制:http://nginx.org/en/docs/stream/ngx_stream_limit_conn_module.html
原文:https://www.cnblogs.com/keta/p/14777969.html