What does the burst option do in the nginx limit_req directive?
Think about how nginx handles sudden spikes in requests.
The burst option lets nginx queue extra requests beyond the rate limit temporarily, allowing short bursts of traffic without immediate rejection.
What is the effect of adding the nodelay option to the limit_req directive in nginx?
Consider how nodelay changes request handling timing.
With nodelay, requests within the burst limit are not delayed but processed immediately, allowing faster handling of bursts.
Given this nginx configuration snippet:
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=1r/s; limit_req zone=mylimit burst=3 nodelay;
What will the error log show if a client sends 5 requests instantly?
Remember the burst allows extra requests beyond the rate, and nodelay processes them immediately.
The rate is 1 request per second, burst=3 allows 3 extra requests, so 4 requests are accepted immediately. The 5th exceeds burst and is rejected with 503.
An nginx server uses limit_req zone=mylimit burst=5; without nodelay. Clients report delays even when sending requests within burst limit. Why?
Think about how nginx handles queued requests without nodelay.
Without nodelay, requests within burst are delayed to spread them evenly, which can cause delays clients notice.
You manage a high-traffic API and want to allow short bursts of up to 10 requests without delay but reject any requests beyond that immediately. Which nginx configuration is best?
Consider how to allow bursts without delay and reject excess requests.
Using burst=10 with nodelay allows up to 10 requests to be processed immediately. Requests beyond 10 are rejected. Option A is invalid syntax; option A delays burst requests; option A allows fewer bursts.