multiple limit_req_zone

Valentin V. Bartenev vbart at
Mon Sep 15 23:02:16 UTC 2014

On Monday 15 September 2014 16:05:31 matt_l wrote:
> Valentin,
> Thank you so much for your example. It definitely helps.
> When you say "A client IP address serves as a key. [...]. One megabyte zone
> can keep about 16 thousand 64-byte states."  Does that mean that 1 megabyte
> zone can keep the state on 16 thousand different sending IP addresses?


> What about the following 2 use cases:
>  Use Case #1: One receives 10 requests per second from 10 different
> clients/IPs each of them sending 1 request per second
>  Use Case #2: One receives 10 requests per second from 1 client/IP sending
> 10 requests per second.
> Should the zone size be different?

Each state is needed to be kept till it has something in the bucket.

If in the first case the clients doesn't send requests at the same time, but 
with 100ms interval between each other, then a place for one state would be 
enough.  Otherwise, nginx will need up to 10 states to handle them.

In the second case only one state is used.

  wbr, Valentin V. Bartenev

More information about the nginx mailing list