Why rate limiting matters
Credential stuffing, scrapers and scalper bots share one trait: many requests in a short time. Blocking by IP often hurts real users behind shared exits.
How token buckets work
Each visitor gets a bucket of tokens. Every request spends one, and tokens refill at a steady rate. Normal browsing rarely runs out, while bursts of abuse are held back.
Use different buckets by path, method or a custom key: stricter for login, looser for product pages.
Recommended setup
Run in log-only mode for a week, pick thresholds from the security logs, then switch to blocking to keep false positives low.



