Web apps & software

What is rate limiting?

Rate limiting is a control that restricts how many requests a user, API key or IP address can make within a time window, for example 60 per minute. Requests over the limit are rejected, usually with HTTP status 429 Too Many Requests.

What it protects against

  • Password guessing and credential stuffing on login and reset forms.
  • Bots scraping prices or hammering a contact form.
  • One heavy customer slowing the system for everyone else on a shared SaaS.
  • Runaway scripts, including your own, that loop by mistake and run up cloud bills or third-party fees.

How it is implemented

Common algorithms are the fixed window (count per calendar minute), sliding window (smoother, fewer bursts at window edges) and token bucket (allows short bursts but enforces an average). Counters typically live in Redis so every server sees the same numbers. Limits can be applied at the web server, an API gateway, a CDN or inside the application.

Being on the receiving end

Every third-party API you call, from Google Maps to an SMS provider, rate-limits you too. Good integrations read the Retry-After header, back off and retry later rather than failing outright. Publish your own limits in the API documentation and return clear 429 responses, so partners can build against them.

Questions, answered

Often used interchangeably; throttling sometimes means slowing requests down rather than rejecting them.

Per user or key where possible, since many users can share one IP behind an office or mobile network.

By the Stegnor team · Updated