Skip to content
Theory · Rate limiter · lesson 7 of 10

Counters across many servers

The algorithm from the last lesson works on one machine. We have 50 gateway instances in each region, and the load balancer sends a client's requests to any of them. If each instance counts the client in its own memory, the limit stops being a limit. This lesson is about making the counter shared while still staying within milliseconds.

In this lesson

  • The limit multiplies by the number of servers
  • The last allowed request
  • All of a client's counters in one hash slot
  • What else you can propose
  • Regions
  • A client that sends far too much
  • Common mistake
  • Key points