Expand description
Graceful degradation under load — rate limiting, concurrency control, and load shedding.
This module provides the infrastructure for RavenClaws to degrade gracefully under load rather than failing hard. It includes:
- Rate limiting — Token bucket algorithm for per-endpoint and global rate limits
- Concurrency control — Semaphore-based limit on in-flight requests
- Load shedding — Metrics-based overload detection and 503 responses
- Backpressure — Queue depth tracking and admission control
§Architecture
┌──────────────┐ ┌──────────────────┐ ┌────────────────┐
│ Incoming │ ──→ │ LoadManager │ ──→ │ Agent/Server │
│ Requests │ │ ┌────────────┐ │ │ Handler │
│ │ │ │ RateLimiter│ │ │ │
│ │ │ ├────────────┤ │ │ │
│ │ │ │ Concurrency│ │ │ │
│ │ │ │ Limiter │ │ │ │
│ │ │ ├────────────┤ │ │ │
│ │ │ │ LoadShedder│ │ │ │
└──────────────┘ └──┴────────────┴──┘ └────────────────┘§Stability
All public types are #[non_exhaustive] — new fields and variants may be added
in minor releases.
Structs§
- Error
Tracker - Tracks error rates within a sliding time window for overload detection.
- Load
Config - Load management configuration (v1.1.0)
- Load
Manager - Central load management coordinator.
- Load
Metrics - Snapshot of load manager metrics.
- Token
Bucket - Token bucket rate limiter.
Enums§
- Admission
- Result of an admission check — whether a request is allowed through.
- Request
Outcome - Outcome of a request processed through the load manager.