Manage throttling counter
You can either create a new throttling counters or delete those already exisiting.
Create a throttling counter
In the API throttling panel of API Keys and Traffic Management, you can set up throttling counters for specific sets of input conditions that incoming requests will match. In other words, you set up match criteria that determine whether a specific request increments the counter and applies toward the moving average threshold set for that counter.
API
You can also complete this task by using the API Keys and Traffic Management API. Run the Create a throttling counter operation.
-
In API Keys and Traffic Management, select the API throttling tab.
-
Click + or Create a new counter to create a throttling counter.
-
In the Counter name field, enter a meaningful name for the counter.
For example, if you are creating a counter that limits requests to a particular registered API, you can use the name of this API to name the counter. -
From the Access control group list, select the access control group that you want to associate with the counter.
-
In the Throttling limit per second field, enter the allowed number of requests per second.
Enter the maximum number of requests that can go through an edge server within one second. -
In the Counter notes field, enter meaningful notes about the counter for future reference, and click Save.
-
Configure throttling rate settings:
- Optionally, in the Throttling limit per second field, adjust the maximum number of requests that can go through an edge server within one second.
- In the When limit is reached field, select the preferred API Gateway behavior when the throttling counter reaches its requests-per-second limit:
- Select Warn to allow all requests to reach your origin.
For this behavior, it is required to configure alerting to receive notifications when the throttling limit reaches 80% for this counter. See the next step in this procedure. - Select Deny to reject the requests that exceed the throttling limit for this counter.
If the request count reaches the defined limit, API Gateway rejects any excessive requests with a429
response until the moving average for this throttling counter diminishes to the set threshold, and additional alerts may be sent if configured. This usually takes up to ten seconds.
- Select Warn to allow all requests to reach your origin.
-
Add alerting to your behavior to be notified when 80% of the throttling limit value is reached. Alert is required for the Warn behavior, and optional for Deny.
- Click Add Alert to create an alert configuration.
- In the Alert name field, enter a meaningful name for the alert.
- In the Emails field, enter the internal email addresses to send the alert to. Internal email addresses end with akamai.com.
- To view your alert configuration and history of its occurrence in the Control Center Alerts application, click ... > View in alerting app.
-
Optionally, in the Error response customization section, customize the error response.
- Enable Override default response for the error message that will be sent to client in case of limit violation. If you don't customize error response, the alert message is sill sent.
- Add status code, message body, and headers.
-
In the Throttling headers section, select the response headers to return to the origin or API client.
Header | Description |
---|---|
X-Throttling-Limit | The requests-per-second limit set for a throttling counter. |
X-Throttling-Rate | The current rate which throttling is handling in the current second. |
- From the Add condition menu, add one or multiple rules to specify conditions for throttling and save.
If you create a counter but don't add any rules to it, the throttling has no effect.
Delete a throttling counter
If you no longer want a throttling counter with specific conditions to increase when requests that match the conditions reach your APIs, you may delete the throttling counter.
API
You can also complete this task by using the API Keys and Traffic Management API. Run the Delete a throttling counter operation.
-
In API Keys and Traffic Management, select the API throttling tab.
-
Clik the counter you want to delete.
-
Click the ... menu next to the Help link, and click Delete a throttling counter.
-
In the confirmation window, click Yes.
Updated 9 months ago