questions about limit_req_zone, what's the difference between rate= and burst=

Ruslan Ermilov ru at nginx.com
Thu Jul 19 09:42:18 UTC 2012


On Thu, Jul 19, 2012 at 03:34:09PM +0800, fhal wrote:
>     Hi All,
> 
>    According to NGINX wiki,
> 
>    limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
> 
>        server {
>            location /search/ {
>                limit_req   zone=one  burst=5;
>            }
> 
>    means  allows a user no more than 1 request per second on average, with
>    bursts of no more than 5 requests.
> 
>    But what's the difference between rate= and burst=?
>    For example,
> 
>    limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
>    limit_req   zone=one  burst=5;
> 
>    limit_req_zone  $binary_remote_addr  zone=one:10m   rate=5r/s;
>    limit_req   zone=one  burst=1;
> 
>    What's the difference between above code? From my understanding, for both
>    settings, users can establish no more than 6 requests at the same time.

http://nginx.org/en/docs/http/ngx_http_limit_req_module.html



More information about the nginx mailing list