Catalogue / classdojo-2021-sliding-window-rate-limiter

ClassDojo replaced its Redis sorted-set rate limiter with per-interval counters after the limiter itself slowed the API

ClassDojo, 2021. API rate limiter.

Organisation
ClassDojo
Evidence
Reported from production
Source
Even Better Rate Limiting

ClassDojo Engineering, published 2021-08-25

Records

Failure#f1

As traffic grew, the sorted-set rate limiter's own Redis work grew with it, and requests queued and timed out

Decision#d1

Switch from a sliding log of request timestamps to a sliding-window counter with one Redis integer per interval

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.