9

What is the difference between this:

limit_req_zone $binary_remote_addr zone=flood:10m rate=30r/s;
limit_req zone=flood nodelay

and:

limit_req_zone $binary_remote_addr zone=flood:10m rate=30r/s;
limit_req zone=flood burst=5 nodelay

Documentation http://wiki.nginx.org/HttpLimitReqModule.

3 Answers 3

1

In your case:

allow no more than 30 requests per second at an average, with bursts not exceeding 5 requests.

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

1
  • 2
    Using the word being defined in its definition isn't very useful. What is a "burst" in the context of limit_req? (The other answers answer this)
    – Jahed
    Commented Aug 13, 2017 at 20:14
15

As it says about burst on http://nginx.org/en/docs/http/ngx_http_limit_req_module.html

Excessive requests are delayed until their number exceeds the maximum burst size

This means in your case the first 5 requests are 'ignored' and only requests 6 and up are counted. So on request 35 the limit of 30 is reached. Then, on request 36 within the same 1 second coming from the same origin, nginx will send a 503 response instead of treating the request any further.

6

Burst means it will be delayed for next second, if there is excess 30 request/second then nginx send 503 error code.

Burst works just like a queue

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .