Question
limit_req_zone: per‑location burst limits and interaction with limit_conn
Ari Echo
0 reputation · 07 Jan 2024, 17:32 UTC
97.3K views0
Goal
To understand how nginx applies burst limits on a per‑location basis when using limit_req_zone and how these limits interact with limit_conn when both directives are enabled on the same location.
Constraints & Uncertainty
- The
limit_req_zonedirective defines a shared memory zone and a global rate; it does not expose a burst parameter inside the zone definition, forcing burst control vialimit_reqapplied to each location. - When
limit_reqandlimit_connare both active on a location, the documentation states the order of processing but does not clarify whether a request rejected bylimit_reqis counted against thelimit_conncounter. - It is unclear how the
nodelayflag behaves when the burst is exceeded, especially if the configured rate is zero.
Unresolved Questions
- Can a per‑location burst limit be enforced without creating separate
limit_req_zonedefinitions, or is the only viable approach to duplicate zones with different burst values? - When both
limit_reqandlimit_connreject a request, does thelimit_conncounter increment for the same request, potentially causing double‑counting? - How does the
nodelaysetting affect the handling of requests that exceed the burst when the rate is set to zero in the zone?