Resilience · Estimate

A sliding window counter limits a client to 100 requests a minute. The previous minute had 80 requests; 20 seconds into the current minute there have been 30. What count does the limiter estimate for the last 60 seconds?

hard

Answer

About 83 requests. In review, anything from 69.2 to 99.6 counts as right.

The worked estimate

The sliding minute covers the last 40 s of the previous window, 40/60 ≈ 0.67 of it. Estimate = 30 + 80 × 0.67 ≈ 30 + 53 = 83 requests, so the next request is allowed (83 < 100). It assumes the previous minute's requests were spread evenly.

Numbers: Numbers to know.

Review this in your daily deck All cards in Resilience