Rate limit

    If the rate limit service is called, and the response for any of the descriptors is over limit, a 429 response is returned.

    If there is an error in calling rate limit service or rate limit service returns an error and failure_mode_deny is set to true, a 500 response is returned.

    Attention

    This section is written for the v1 API but the concepts also apply to the v2 API. It will be rewritten to target the v2 API in a future release.

    Each on the route or virtual host populates a descriptor entry. A vector of descriptor entries compose a descriptor. To create more complex rate limit descriptors, actions can be composed in any order. The descriptor will be populated in the order the actions are specified in the configuration.

    The configuration would be:

    Example 2

    If an action doesn’t append a descriptor entry, no descriptor is generated for the configuration.

    For the following configuration:

    If a request did not set , no descriptor is generated.

    If a request sets x-forwarded-for, the the following descriptor is generated:

    The HTTP rate limit filter supports the following runtime settings:

    ratelimit.http_filter_enabled

    % of requests that will call the rate limit service. Defaults to 100.

    ratelimit.http_filter_enforcing

    % of requests that will call the rate limit service and enforce the decision. Defaults to 100. This can be used to test what would happen before fully enforcing the outcome.

    % of requests that will call the rate limit service for a given route_key specified in the . Defaults to 100.