How to control the total requests in Ngnix

tongshushan at migu.cn tongshushan at migu.cn
Fri Dec 1 03:18:06 UTC 2017


I configured as below:
limit_req_zone "all" zone=all:100m rate=2000r/s;
limit_req zone=all burst=100 nodelay;
but when testing,I use tool to send the request at: Qps:486.1(not reach 2000)  I got the many many 503 error,and the error info as below:

 2017/12/01 11:08:29 [error] 26592#37196: *15466 limiting requests, excess: 101.000 by zone "all", client: 127.0.0.1, server: localhost, request: "GET /private/rush2purchase/inventory/aquire?productId=product1 HTTP/1.1", host: "localhost"

Why excess: 101.000? I set it as 2000r/s ?



童树山
咪咕视讯科技有限公司 研发部
Mobile:13818663262
Telephone:021-51856688(81275)
Email:tongshushan at migu.cn
 
From: Francis Daly
Date: 2017-12-01 02:38
To: nginx
Subject: Re: Re: How to control the total requests in Ngnix
On Thu, Nov 30, 2017 at 08:04:41PM +0800, tongshushan at migu.cn wrote:
 
Hi there,
 
> what is the same "key " for all requests from different client ips for limit_conn_zone/limit_req_zone? I have no idea on this.
 
Any $variable might be different in different connections. Any fixed
string will not be.
 
So:
 
  limit_conn_zone "all" zone=all...
 
for example.
 
f
-- 
Francis Daly        francis at daoine.org
_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20171201/e0eea5b7/attachment-0001.html>


More information about the nginx mailing list