How to control the total requests in Ngnix

tongshushan at migu.cn tongshushan at migu.cn
Fri Dec 1 04:53:56 UTC 2017


I sent the test requests from only one client.




童树山
咪咕视讯科技有限公司 研发部
Mobile:13818663262
Telephone:021-51856688(81275)
Email:tongshushan at migu.cn
 
From: Gary
Date: 2017-12-01 12:17
To: nginx
Subject: Re: How to control the total requests in Ngnix
I thought the rate is per IP address, not for whole server. 

From: tongshushan at migu.cn
Sent: November 30, 2017 7:18 PM
To: nginx at nginx.org
Reply-to: nginx at nginx.org
Subject: Re: Re: How to control the total requests in Ngnix

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/e0e8b682/attachment-0001.html>


More information about the nginx mailing list