4

I am experiencing unusual behavior with rate limiting in NGinX. I have been tasked with supporting 10 requests per second and not to use the burst option. I am using the nodelay option to reject any requests over my set rate.

My config is: .. http { .. limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; .. server { .. location / { limit_req zone=one nodelay; limit_req_status 503; .. } } }

The behavior I am seeing is if a request is sent before a response is received from a previous request NGinX will return a 503 error. I see this behavior with as little as 2 requests in a second.

Is there something missing from my configuration which is causing this behavior? Is the burst option needed to service multiple requests at once?

1 Answer 1

2

Burst Works like a queue. No delay means the requests will not be delayed for next second. If you are not specifying a queue then you are not allowing any other simultaneous request to come in from that IP. The zone takes effect for per ip as your key is $binary_remote_addr.

You need a burst.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.