Interview Prep/Networking/Load Balancing, Proxies & CDN

How do you rate-limit abusive clients at the edge?

IntermediateScenarioLoad Balancing, Proxies & CDN
Answer

Situation read → The limit belongs as close to the attacker as possible.

What I'd do →

  1. Use AWS WAF rate-based rules, for example 2000 requests per 5 minutes per IP, on CloudFront or the ALB
  2. Or Nginx: limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s; plus limit_req zone=api burst=20 nodelay;
  3. Return 429 with Retry-After
  4. Key on API key or user when many clients share NAT IPs
  5. Monitor blocked counts

Why → Limits on source IP are crude for mobile carriers and offices behind NAT, so keys matter.

Interview tip → Say you always start in count mode before blocking.

All Networking questions Roadmap: Networking for DevOps

More on Load Balancing, Proxies & CDN