Concurrent Strategy
The Concurrent strategy sets a limit on the number of simultaneous requests rather than tracking requests within a time window. This approach helps manage concurrent traffic across various flows and endpoints, reducing server strain during high-traffic periods.
Defines a maximum allowed concurrent requests limit (max_request_count
).
If the limit is reached, additional requests are blocked until active requests finish, freeing up capacity for new requests.
Supports optional headers for reporting remaining limits.
/etc/lunar-proxy/quotas/{fileName}.yaml
quotas:
- id: ConcurrentQuota # Unique identifier for the quota
filter: # Define filter conditions for this quota
url: api.website.com/* # URL pattern to apply the quota
strategy:
concurrent:
max_request_count: 50 # Maximum concurrent requests allowed
remaining_header: X-Concurrent-Remaining # Optional: Header to expose remaining concurrent requests