0
0
Nginxdevops~20 mins

Burst and nodelay options in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Burst and Nodelay Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding the burst option in nginx rate limiting

What does the burst option do in the nginx limit_req directive?

AAllows a client to exceed the rate limit by a specified number of requests temporarily.
BImmediately rejects requests that exceed the rate limit without delay.
CSets the maximum number of requests allowed per second.
DDisables rate limiting for burst traffic.
Attempts:
2 left
💡 Hint

Think about how nginx handles sudden spikes in requests.

🧠 Conceptual
intermediate
1:30remaining
Effect of the nodelay option in nginx rate limiting

What is the effect of adding the nodelay option to the limit_req directive in nginx?

ARequests exceeding the burst limit are delayed before processing.
BRequests within the burst limit are processed immediately without delay.
CDisables the burst option entirely.
DCauses nginx to reject all requests immediately.
Attempts:
2 left
💡 Hint

Consider how nodelay changes request handling timing.

💻 Command Output
advanced
2:00remaining
Output of nginx error log with burst and nodelay

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?

AOnly 1 request is accepted immediately; the rest are rejected.
BAll 5 requests are delayed and accepted without errors.
CThe first 4 requests are accepted immediately; the 5th request is rejected with 503 error.
DAll 5 requests are rejected immediately.
Attempts:
2 left
💡 Hint

Remember the burst allows extra requests beyond the rate, and nodelay processes them immediately.

Troubleshoot
advanced
2:00remaining
Troubleshooting unexpected delays with burst and nodelay

An nginx server uses limit_req zone=mylimit burst=5; without nodelay. Clients report delays even when sending requests within burst limit. Why?

AThe rate limit is set too high, causing delays.
BNginx is rejecting requests instead of delaying them.
CThe burst option is ignored without nodelay, so all requests are delayed.
DRequests within burst are delayed to smooth traffic, causing perceived delays.
Attempts:
2 left
💡 Hint

Think about how nginx handles queued requests without nodelay.

Best Practice
expert
2:30remaining
Choosing burst and nodelay settings for a high-traffic API

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?

Alimit_req zone=api burst=10 nodelay;
Blimit_req zone=api burst=10;
Climit_req zone=api burst=5 nodelay;
Dlimit_req zone=api burst=10 delay=0;
Attempts:
2 left
💡 Hint

Consider how to allow bursts without delay and reject excess requests.