Skip to main content

Module load

Module load 

Source
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§

ErrorTracker
Tracks error rates within a sliding time window for overload detection.
LoadConfig
Load management configuration (v1.1.0)
LoadManager
Central load management coordinator.
LoadMetrics
Snapshot of load manager metrics.
TokenBucket
Token bucket rate limiter.

Enums§

Admission
Result of an admission check — whether a request is allowed through.
RequestOutcome
Outcome of a request processed through the load manager.