Skip to main content

Rate Limiting

Rate limiting protects backends from excessive traffic by limiting request rates per client or globally.

Prerequisites​

Rate limiting requires:

  • Redis: Backend storage for rate limit counters
  • Envoy Gateway Rate Limit Service: Deployed and configured

The route builder flags whether rate limiting is available for your project.

Configure​

In the route builder, open the Traffic tab and expand the Backend Traffic Policy section. Under Rate Limiting, turn on Enable Rate Limiting, then set Requests to the allowed count and Per to the time window, for example 100 requests per Minute.

Units​

UnitDescription
SecondRequests per second
MinuteRequests per minute
HourRequests per hour
DayRequests per day

Client Selectors​

By default the limit applies to all matched traffic. To scope it, click Show Client Selectors (Advanced) and Add Selector. Multiple selectors are OR'd together.

SelectorDescription
HeadersMatch a header by Name and optional Value, with Type Exact or Distinct
Source CIDRMatch a client IP or CIDR range, with Type Exact or Distinct
Path MatchMatch a request path, with Type Exact, PathPrefix, or RegularExpression
HTTP MethodsMatch one or more methods, for example GET, POST, PUT

Use Distinct to apply a separate limit to each unique value, for example a per-API-key limit via a Distinct header selector on X-API-Key.

Rate Limit Response​

When limits are exceeded, clients receive:

  • Status Code: 429 Too Many Requests
  • Headers: Rate limit information

The REST API equivalent is documented in the API Reference.