Skip to content

Support quota-based rate limiting (RLQS) #14389

Description

@davidxia

kgateway version

2.3.2

Is your feature request related to a problem? Please describe.

kgateway's global rate limiting is only implemented via Envoy's per-request rate_limit HTTP filter (envoy.extensions.filters.http.ratelimit.v3.RateLimit), documented at https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/rate_limit_filter. This filter makes a synchronous gRPC call to the external rate limit service for every request that matches a configured rate limit action, putting the rate limit service directly on the hot path of every request. This adds a network round-trip of latency to every rate-limited request and creates a hard availability/scaling coupling between the gateway's request path and the rate limit service.

Describe the solution you'd like

Add support for Envoy's Rate Limit Quota Service (RLQS) as an additional global rate limiting mode in kgateway (see https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_features/global_rate_limiting). Under RLQS, Envoy periodically reports usage to the rate limit service and receives quota assignments back over a streaming/periodic model, then enforces limits locally against the assigned quota rather than calling out synchronously on every request. This would let kgateway offer users a global rate limiting mode that keeps the rate limit service out of the request hot path, trading some enforcement precision for lower latency and reduced load/availability coupling on the rate limit service.

Describe alternatives you've considered

  • Continue using only the existing per-request rate_limit filter — simplest, but keeps the rate limit service in the hot path for every request.
  • Local (non-global) rate limiting — avoids the network hop entirely, but doesn't provide consistent enforcement across multiple gateway instances/replicas.

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions