FA-73763 / Rate limiter algorithms / Member archive
EWMA arrival-rate throttle: decay constant treated as seconds · case 03
The estimate barely reacts to new arrivals and throttling kicks in minutes late.
Case contract
Input {tau_ms, limit_rps, requests [t_ms]}. The rate estimate r starts at 0. For each arrival strictly after the latest seen time, dt = t - last, a = exp(-dt/tau) and r = a*r + (1-a)*(1000/dt) requests per second. Simultaneous or late arrivals leave r unchanged and never move the clock backwards. Every arrival reports deny if r > limit else allow, with r rounded to 3 decimals.
Why this case matters
Irregular-interval EWMA estimators throttle clients by smoothed request rate; time-unit and duplicate-timestamp handling decide whether bursts are detected.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| steady ten per second | [["allow", 0.0], ["allow", 0.001], ["allow", 0.002], ["allow", 0.003], ["allow", 0.004], ["allow", 0.005], ["allow", 0.006], ["allow", 0.007], ["allow", 0.008], ["allow", 0.009]] | [["allow", 0.0], ["allow", 0.952], ["allow", 1.813], ["allow", 2.592], ["allow", 3.297], ["allow", 3.935], ["allow", 4.512], ["allow", 5.034], ["allow", 5.507], ["allow", 5.934]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗