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:tongshus...@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, tongshus...@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        fran...@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to