How to Design a Scalable Rate Limiting Algorithm