Infrastructure · Primitives

Throttle

Rate-limiting to prevent resource exhaustion

Definition

Mechanism

Rate Limiting: Maximum N Tasks per time window W. Excess requests rejected, queued, or delayed. Window can be sliding or fixed. Separate limits per action type or global. Utilizes Backoff.

Preconditions

  1. Token bucket or Leaky bucket state initialized

Invariants

  1. Rate limit: output rate ≤ `rate_limit` within any `window`, sliding or fixed.
  2. Excess is handled by the declared `excess_policy` — rejected, queued, or delayed. Only rejection drops.

Risks

Failure modes

  1. Unbounded queue

    `excess_policy` is queue or delay and arrivals stay above the limit, so latency grows without anything being dropped or refused.

Relationships

Builds on

Accepts

Task

The atomic unit of intent

Composes with

Backoff

Delay subsequent attempts after failure or contention

Used by

References

Cooldown

Mandatory delay between repeated actions

Warmup

Gradual capacity increase to stabilize cold systems

Reference

Parameters

rate_limit Integer, [1, 10000]
Max requests per window
window Duration, [1s, 1h]
Time window for rate calculation
burst_size Integer, [1, 100]
Temporary overflow allowance
excess_policy Enum, {reject, queue, delay}
What happens above the limit. Named in the intersection and previously expressible nowhere.

Identity

Ref
Throttle#dd62
Sema ID
sema:Throttle#mh:SHA-256:dd626ad2479e5377339f44e77b61a0264591ed21a906556f020fccb98450fe55
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Throttle#mh:SHA-256:3b435aa8eded864eadf7d8eec80d395fd7f4e6c2749d33880cbf8c4593f926af
  • sema:Throttle#mh:SHA-256:24860a38fb19f46f0cd620ada5ec2abadef4377dc6c0459f14180e4ce7aed7c8
  • sema:Throttle#mh:SHA-256:dc1439d0fbf64ac81ebea3d7570e55d7b94802d028061470a2e5681bc3c1d5f6