Expand description
Admission-based rate limiting for throughput and bandwidth.
This module provides RateLimiter, which enforces configurable limits at three
levels of granularity — global, per-usecase, and per-scope — for both request
throughput (requests/s) and upload/download bandwidth (bytes/s).
General capacity limits reject with HTTP 503, while explicit throughput rules reject with HTTP 429. The first exceeded limit determines the rejection.
Throughput is enforced using token buckets. Bandwidth uses debt-based GCRA (Generic Cell Rate Algorithm) buckets that track a theoretical arrival time (TAT). All rate-limit checks are synchronous, non-blocking, and lock-free.
Structs§
- Bandwidth
Handle - Handle for recording bandwidth consumption against GCRA buckets.
- Bandwidth
Limits - Bandwidth limits applied at global, per-usecase, and per-scope granularity.
- Rate
Limiter - Combined rate limiter that enforces both bandwidth and throughput limits.
- Rate
Limits - Rate limits for objectstore.
- Throughput
Limits - Request throughput limits applied at global, per-usecase, and per-scope granularity.
- Throughput
Rule - An override rule that applies a specific throughput limit to matching request contexts.
Enums§
- Limit
Exceeded - Classifies a rejected request as capacity protection or an exceeded traffic allowance.
Constants§
- HEADER_
ENVOY_ RATELIMITED - Response header that prevents Envoy from retrying a response.