Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limiter documentation #3982

Merged
merged 15 commits into from
Nov 8, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ As a system programmer, you can customize your configuration for how API ML mana
* To change the number of concurrent connections per route passing through the API Gateway, see [Customizing connection limits](./configuration-connection-limits.md).

* To change the global Gateway timeout value for the API ML instance, see [Customizing Gateway timeouts](./configuration-gateway-timeouts.md).

* To change the number of concurrent requests an application should support and its impact on the size of the Java memory heap, see [Customizing Java Heap sizes](./configuration-customizing-java-heap-sizes.md).

* To customize the rate limit for each service, see [Customizing Gateway rate limiter](./customizing-gateway-rate-limiter.md).

* Also see the following properties in API Gateway configuration parameters:
* `server.maxTotalConnections`
Expand Down
36 changes: 36 additions & 0 deletions docs/user-guide/api-mediation/customizing-gateway-rate-limiter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Customizing Gateway rate limiter

:::info Role: system programmer
:::

The API Gateway offers a way to customize the rate limit for each service via a configurable rate limiter, which prevents individual users from overloading the system with excessive requests. Configuring the rate limiter helps ensure that a user's activity does not negatively impact the experience of other users by mitigating the risk of Distributed Denial-of-Service (DDoS) attacks and other automated exploit attempts.

Use the following procedure to customize the Gateway rate limiter:

1. In the zowe.yaml, set the following rate limiting properties in api/gateway/routing:

* **rateLimiterCapacity**
Defines the total number of requests that can be allowed at one time per user.

* **rateLimiterTokens**
Defines the number of requests that are added to the service’s allowance at regular intervals. This property controls how quickly requests are replenished after being consumed.

* **rateLimiterRefillDuration**
Sets the time interval (in minutes) at which new requests (or tokens) are added.

2. Define the services to limit:

Use `servicesToLimitRequestRate` to specify a list of services to limit. In the following example, this property applies to the API Catalog.

**Example configuration:**
```
apiml:
gateway:
routing:
rateLimiterCapacity: 20
rateLimiterTokens: 20
rateLimiterRefillDuration: 1
servicesToLimitRequestRate: apicatalog
```
You configured the properties of the rate limiter for the API Catalog, thereby improving user accessibility and overall system stability.

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ module.exports = {
"items": [
"user-guide/api-mediation/configuration-connection-limits",
"user-guide/api-mediation/configuration-gateway-timeouts",
"user-guide/api-mediation/customizing-gateway-rate-limiter",
"user-guide/api-mediation/configuration-customizing-java-heap-sizes"
]
}
Expand Down
Loading