Skip to main content

Module rate_limits

Module rate_limits 

Source
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).

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§

BandwidthHandle
Handle for recording bandwidth consumption against GCRA buckets.
BandwidthLimits
Bandwidth limits applied at global, per-usecase, and per-scope granularity.
RateLimiter
Combined rate limiter that enforces both bandwidth and throughput limits.
RateLimits
Rate limits for objectstore.
ThroughputLimits
Request throughput limits applied at global, per-usecase, and per-scope granularity.
ThroughputRule
An override rule that applies a specific throughput limit to matching request contexts.