Configuring rate limits on the gateway nodes
Create an env.yaml file on each Gateway node to configure the default rate limit.
The Gateway uses scale limits (instead of strict limits) by default to enforce rate limits. This improves the gateway's performance by providing the ability to handle large amounts of rate-limited traffic.
1. To configure the rate limit, create a file called env.yaml with the settings provided in Table 1:
Setting | Type | Default | Optoins | Comments |
---|---|---|---|---|
USE_RATE_LIMIT_DEFINITION |
boolean | true |
|
Determines the type of rate limiting to use on the Gateway node. |
RATE_LIMIT_UPDATE_MODE |
enumerated | prior |
|
Determines how the counts within a plan are incremented when a rate limit is hit. Applies only to scale limits. |
RATE_LIMIT_SORT_BY_DURATION |
boolean | true |
|
Determines the sort order for rate limits in a plan, which in turn determines the sequence in which they are applied. |
RATE_LIMIT_USE_OFFSET |
boolean | false |
|
Allow or prevent all of the rate limit counts for an interval from being reset at the same time. Preventing the simultaneous reset protects backends from being saturated with requests by resetting the counts for different subscribers of a plan at different points with in the interval. Applies only to scale limits. |
RATE_LIMIT_DEFINITION_RESPONSE_HEADERS |
boolean | true |
|
Show or hide the |
2. Save the file in the local:/ directory on the Gateway node so that the file persists on reboots of both physical and virtual machines. The settings apply only to the node where the file is stored, so each node in the Gateway cluster requires its own copy of the file.