Approaches to application request throttling
summary
Experience from MyGet.org shows simple DB logging (user/action/timestamp) works but the DB becomes the bottleneck; a prototype enforces 5 requests per 5 seconds and returns HTTP 429 Too Many Requests. Better options use counters: Redis sorted sets for timestamp lists, leaky/quantized bucket algorithms, or middleware/action filters (mvc throttle) to block early. At the edge use Nginx (example 2 req/s with bursts to 5) or cloud gateways like Azure API Management to enforce per-key limits, log hits, and offer paid exceptions.
AI-written summary · about
chapters (18)
- 0:00Start
- 0:49Users and Traffic Patterns
- 3:13Too Many Downloads
- 5:38Rate Limiting
- 6:06Bandwidth Throttling
- 9:04Rate Limit Attribute
- 13:55Quantized Buckets
- 14:55Downsides to Quantized Buckets
- 16:10Leaky Buckets
- 18:02Adding Items to a Sorted Set in Redis
- 24:42Exceptions
- 25:13Web Crawlers
- 31:25Additional Endpoint Rules
- 37:09Reverse Proxy
- 37:54Configure Nginx
- 41:02Identifiers
- 43:58Api Management
- 46:12Define Policies
