How to control the total requests in Ngnix

tongshushan at migu.cn tongshushan at migu.cn
Wed Dec 6 01:49:45 UTC 2017


Hi there,

I have combined the client ip concurrency and cluster concurrency(total requests) together as below ,seems it works as expected.

limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; # one client ip concurrency
limit_req_zone "all" zone=all:20m rate=2000r/s; #cluster concurrency
server {
location /private/rush2purchase/ {                  
                            proxy_pass http://my_server/private/rush2purchase/;
                            proxy_set_header Host $host:$server_port;    
                            limit_req zone=one burst=15 nodelay;
                            limit_req zone=all burst=3000 nodelay;
         }
} 

Thanks all guys.



Tong
 
From: Francis Daly
Date: 2017-12-05 16:51
To: nginx
Subject: Re: Re: How to control the total requests in Ngnix
On Sun, Dec 03, 2017 at 11:58:16AM +0800, tongshushan at migu.cn wrote:
 
Hi there,
 
> I might have misunderstood some concepts and rectify them here:
> burst--bucket size;
 
Yes.
 
> rate--water leaks speed (not requests sent speed)
 
Yes.
 
The server can control how long it waits before starting to process a
request (rate) and how many requests it will process quickly (burst). It
cannot control when the requests are sent to it.
 
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/20171206/b80ae217/attachment-0001.html>


More information about the nginx mailing list