Approaches for application request throttling
summary
Case study of MyGet.org shows naive DB-based counters (Entity Framework) kill the database under bursts — tens of thousands of uploads/sec and a 600,000-hit spam form — so implementation moves to fast counters: demoed quantized vs leaky buckets, then a production-ready Redis sorted sets limiter that records timestamps atomically and returns 429s. Also demonstrates pushing limits out to an nginx reverse proxy (or CloudFlare/Azure API Management) to block traffic before the app and recommends logging limits first, then enforcing.
AI-written summary · about
chapters (20)
- 0:00Intro
- 3:01We're using background workers
- 4:11What could possibly go wrong...
- 7:08Other examples
- 8:10Recent, real-life example
- 9:23Rate limiting - what?
- 12:07Rate limiting - everything???
- 17:26That database was a bad idea!
- 19:26Quantized buckets
- 21:46Leaky bucket
- 25:20Bucket approaches
- 29:42Things to decide on
- 30:16What are sensible limits?
- 32:01Will you allow bursts or not?
- 33:34What will be the identifier?
- 35:01Decide on exceptions
- 37:11What when the user hits the limit?
- 39:25Rate limiting - where?
- 46:03What options are there?
- 56:02Conclusion
