0

I'm trying to configure rate limiting using nginx's limit_req feature to achieve a specific use case; I've been testing different options within my nginx configuration file, however, I can't seem to find the correct combination of options to achieve the following:

  • Allow a burst of up to 400 requests in a minute (no delay)
  • After the burst is used up, queue up to 100 requests
  • process 6 request per second from the queue (delayed)
  • if the queue size hits 100, return a HTTP 429 for new requests

I've tried several combinations of burst, delay and nodelay along with setting the request rate in limit_req_zone although I can't seem to achieve this, could you tell me where I'm going wrong?

Thanks

Ash
  • 73
  • 7
  • Also related to this question: https://serverfault.com/questions/936670/nginx-rate-limiting-only-slowdown-if-ceiling-hit?rq=1 – Ash Aug 06 '19 at 15:43
  • Have you tried burst=500 delay=400? – Alexey Ten Aug 07 '19 at 05:28
  • I have, but based on testing it appeared that no matter how many requests I sent i couldn't seem to 'fill' the queue to then generate the error, any ideas why this might be the case? (it effectively seems like the queue length is set infinitely high) – Ash Aug 07 '19 at 08:34

0 Answers0