Skip to main content
Every allowed request stores a timestamp. A request is allowed if fewer than limit timestamps fall inside the last duration seconds.

When to use it

When “100 per hour” must mean 100 in any 60-minute stretch — not 100 at 10:59 and 100 at 11:00.

Notes

There’s a ceiling: 100,000 requests in a single window. Above that, use token bucket or leaky bucket. reset_time is when the oldest request in the window expires — the moment a slot frees up.