Skip to content

Commit

Permalink
Merge pull request #4012 from zowe/reboot/rate-limit-per-service
Browse files Browse the repository at this point in the history
rate limit per service
  • Loading branch information
kishkinova authored Nov 19, 2024
2 parents 7c3bb9d + ee771fc commit 6ede6be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 12 additions & 0 deletions docs/extend/extend-apiml/custom-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ Optionally, service can specify which origins will be accepted by Gateway during
* **customMetadata.apiml.lb.cacheRecordExpirationTimeInHours**
When the property `customMetadata.apiml.lb.type` is set to `authentication`, the user can also define the expiration time for the selected instance information that is cached. This property aims to prevent any discrepancy which might occur if the required target server is no longer available. The default value is 8 hours.

* **customMetadata.apiml.gateway.applyRateLimiterFilter**
This parameter specifies the services that the rater limiter is applied to. When enabling this filter, you can also define the following properties:
* `customMetadata.apiml.gateway.rateLimiterCapacity`
Defines the total number of requests that can be allowed at one time per user
* `customMetadata.apiml.gateway.rateLimiterTokens`
Defines the number of requests that are added to the service’s allowance at regular intervals
* `customMetadata.apiml.gateway.rateLimiterRefillDuration`
Sets the time interval (in minutes) at which new requests (or tokens) are added.

When no values are provided, global values defined in the Gateway are applied. For more information about the default configuration, see [Customizing gateway rate limiter filer](../../user-guide/api-mediation/customizing-gateway-rate-limiter.md).


* **customMetadata.apiml.response.compress**
When this parameter is set to `true`, API ML compresses content for all responses from this services using GZIP. API ML also adds the `Content-Encoding` header with value `gzip` to responses.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ The API Gateway offers a way to customize the rate limit for each service via a

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:
1. In the zowe.yaml, set the following rate limiting properties in api/gateway:

* **rateLimiterCapacity**
Defines the total number of requests that can be allowed at one time per user.
Defines the total number of requests that can be allowed at one time per user. The default value is set to 20.

* **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.
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. The default value is set to 20.

* **rateLimiterRefillDuration**
Sets the time interval (in minutes) at which new requests (or tokens) are added.
Sets the time interval (in minutes) at which new requests (or tokens) are added. The default value is set to 1.

2. Define the services to limit:

Expand All @@ -26,11 +26,10 @@ Use the following procedure to customize the Gateway rate limiter:
```
apiml:
gateway:
routing:
rateLimiterCapacity: 20
rateLimiterTokens: 20
rateLimiterRefillDuration: 1
servicesToLimitRequestRate: apicatalog
rateLimiterCapacity: 35
rateLimiterTokens: 35
rateLimiterRefillDuration: 2
servicesToLimitRequestRate: apicatalog
```
You configured the properties of the rate limiter for the API Catalog, thereby improving user accessibility and overall system stability.

0 comments on commit 6ede6be

Please sign in to comment.