Skip to content

New Page Request throttling #6272

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

Merged
merged 42 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8502313
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 17, 2025
34ea049
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 17, 2025
63a590e
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 18, 2025
e6018c8
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 18, 2025
a3ca6a3
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 24, 2025
c711d7e
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 28, 2025
9e43c62
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 28, 2025
257d2d4
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Mar 28, 2025
ae2d12a
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Apr 1, 2025
c62658d
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Apr 4, 2025
2cd3b03
Merge branch 'master' of https://github.com/TykTechnologies/tyk-docs
sharadregoti Apr 8, 2025
573da22
Fixes
sharadregoti Apr 8, 2025
68ce099
Merge master into request-throttling
buger Apr 8, 2025
c9e74e8
Merge master into request-throttling
buger Apr 8, 2025
568741b
Merge master into request-throttling
buger Apr 8, 2025
6937bcf
Merge master into request-throttling
buger Apr 8, 2025
c1bc9a4
Merge master into request-throttling
buger Apr 8, 2025
5c6f8e3
Merge master into request-throttling
buger Apr 8, 2025
559da4a
Fixes
sharadregoti Apr 9, 2025
6059246
Fixes
sharadregoti Apr 9, 2025
bf487ce
Update tyk-docs/content/api-management/request-throttling.md
letzya Apr 10, 2025
19c1df4
Update request-throttling.md (#6292)
letzya Apr 10, 2025
4e79ec8
Update tyk-docs/content/shared/create-security-policy-include.md
letzya Apr 10, 2025
d3b8eda
Merge master into request-throttling
buger Apr 11, 2025
78dd56b
Merge master into request-throttling
buger Apr 15, 2025
da36cdb
Merge master into request-throttling
buger Apr 15, 2025
5e4e80b
remove tabs, add collapses, add images (#6294)
letzya Apr 15, 2025
cf9328c
Fixes
sharadregoti Apr 15, 2025
1d16c7b
Fixes
sharadregoti Apr 16, 2025
ba59d12
Merge master into request-throttling
buger Apr 16, 2025
009360b
Merge master into request-throttling
buger Apr 16, 2025
b454ca8
Merge master into request-throttling
buger Apr 16, 2025
34050af
Fixes
sharadregoti Apr 16, 2025
6f05d63
Merge branch 'request-throttling' of https://github.com/TykTechnologi…
sharadregoti Apr 16, 2025
524fb56
Merge master into request-throttling
buger Apr 16, 2025
80d31a3
Fixes
sharadregoti Apr 17, 2025
db2b4ec
Fixes
sharadregoti Apr 17, 2025
c93fc26
Merge master into request-throttling
buger Apr 17, 2025
56f3933
Merge master into request-throttling
buger Apr 21, 2025
4c48b7e
Merge master into request-throttling
buger Apr 23, 2025
333fed9
Merge master into request-throttling
buger Apr 23, 2025
1aec5a8
Merge master into request-throttling
buger Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 2 additions & 39 deletions tyk-docs/content/api-management/rate-limit.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Rate Limiting"
date: 2025-01-10
tags: ["Rate Limit", "Rate Limiting", "Rate Limit Algorithms", "Distributed Rate Limiter", "Redis Rate Limiter", "Fixed Window", "Spike Arrest", "Rate Limit Scope", "Local", "Local rate Limits", "Request Throttling", "Quotas", "Tyk Classic", "Tyk Classic API", "Tyk OAS", "Tyk OAS API", "Rate Limiting", "Global limits", "Per API limits", "Request Throttling", "Request Quotas"]
tags: ["Rate Limit", "Rate Limiting", "Rate Limit Algorithms", "Distributed Rate Limiter", "Redis Rate Limiter", "Fixed Window", "Spike Arrest", "Rate Limit Scope", "Local", "Local rate Limits", "Quotas", "Tyk Classic", "Tyk Classic API", "Tyk OAS", "Tyk OAS API", "Rate Limiting", "Global limits", "Per API limits", "Request Quotas"]
description: Overview of Rate Limiting with the Tyk Gateway
keywords: ["Rate Limit", "Rate Limiting", "Rate Limit Algorithms", "Distributed Rate Limiter", "Redis Rate Limiter", "Fixed Window", "Spike Arrest", "Rate Limit Scope", "Local", "Local rate Limits", "Request Throttling", "Quotas", "Tyk Classic", "Tyk Classic API", "Tyk OAS", "Tyk OAS API", "Rate Limiting", "Global limits", "Per API limits", "Request Throttling", "Request Quotas"]
keywords: ["Rate Limit", "Rate Limiting", "Rate Limit Algorithms", "Distributed Rate Limiter", "Redis Rate Limiter", "Fixed Window", "Spike Arrest", "Rate Limit Scope", "Local", "Local rate Limits", "Quotas", "Tyk Classic", "Tyk Classic API", "Tyk OAS", "Tyk OAS API", "Rate Limiting", "Global limits", "Per API limits", "Request Quotas"]
aliases:
- /control-limit-traffic/request-quotas
- /control-limit-traffic/rate-limiting
Expand All @@ -13,7 +13,6 @@ aliases:
- /product-stack/tyk-gateway/middleware/endpoint-rate-limit-oas
- /product-stack/tyk-gateway/middleware/endpoint-rate-limit-classic
- /basic-config-and-security/control-limit-traffic/request-quotas
- /basic-config-and-security/control-limit-traffic/request-throttling
- /product-stack/tyk-streaming/configuration/rate-limits/overview
- /product-stack/tyk-streaming/configuration/rate-limits/local
---
Expand Down Expand Up @@ -857,39 +856,3 @@ To set an unlimited quota, set `quota_max` to `-1`.

[1]: /img/dashboard/system-management/usage_quotas_2.5.png

## Request Throttling

### Controlling and Limiting Traffic

Tyk supports controlling and limiting traffic for throttling and spike arrest use cases. Spike arrest sets a limit on the number of requests that can be processed within a specified time interval. If the incoming request rate exceeds this limit, then excess requests are throttled to ensure availability of the API server.

From v2.8, when hitting quota or rate limits, the Gateway can automatically queue and auto-retry client requests.

Throttling can be configured at a *key* or *policy* level via the following two fields:

1. `throttle_interval`: Interval (in seconds) between each request retry.
2. `throttle_retry_limit`: Total request retry number.


#### Can I disable Request Throttling?

Yes, you can. If you set `throttle_interval` and `throttle_retry_limit` values to smaller than `0`, the feature will not work. The default value is `-1` and means it is disabled by default.

### Set Request Throttling with the Dashboard

1. At the key level: From **System Management** > **Keys** > **Add Key** or open an existing key.
Or
At the policy level: From **System Management** > **Policies** > **Add Policy** or open an existing policy.

2. Ensure the new key or policy has access to the APIs you wish it work with by selecting the API from **Access Rights** > **Add Access Rule** and click **Add**.

3. From the **Throttling** section, select the **Throttle interval** and the **Throttle retry limit** values.

{{< img src="/img/dashboard/system-management/throttling_update.png" alt="Tyk API Gateway Throttling" >}}

4. Save the token/policy.

### Set Request Throttling in the object

Get the policy object with `GET /api/portal/policies/` or the key's session object via `GET /api/apis/{API-ID}/keys/` and then set two fields, `throttle_interval` and `throttle_retry_limit` in the object and create a new object or update the exsiting one.

453 changes: 453 additions & 0 deletions tyk-docs/content/api-management/request-throttling.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tyk-docs/content/api-management/security-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Excessive resource consumption poses a risk to APIs. As the number of concurrent

This issue can be caused by both legitimate consumers and malicious attackers, but they are different situations that require different solutions. For legitimate consumers, solutions should be focused on controlling API utilization through the gateway, to keep usage within agreed or desired limits. But malicious attackers require a different approach, as denial of service attacks must be blocked as far as possible from the core API infrastructure.

**Restrict Request Flows**: Use [rate limits]({{< ref "api-management/rate-limit#rate-limiting-layers" >}}) and [quotas]({{< ref "api-management/rate-limit#request-quotas" >}}) to prevent excessive API usage. Rate limits are best used for short term control, in the range of seconds. Whereas quotas are more suited to longer terms, in the range of days, weeks or beyond. [Throttling]({{< ref "api-management/rate-limit#request-throttling" >}}) can also be used as a type of enhanced rate limiter that queues and retries requests on the clients behalf, rather than immediately rejecting them.
**Restrict Request Flows**: Use [rate limits]({{< ref "api-management/rate-limit#rate-limiting-layers" >}}) and [quotas]({{< ref "api-management/rate-limit#request-quotas" >}}) to prevent excessive API usage. Rate limits are best used for short term control, in the range of seconds. Whereas quotas are more suited to longer terms, in the range of days, weeks or beyond. [Throttling]({{< ref "api-management/request-throttling" >}}) can also be used as a type of enhanced rate limiter that queues and retries requests on the clients behalf, rather than immediately rejecting them.

**Block Excessively Large Requests**: Place reasonable [limitations on payload sizes]({{< ref "api-management/traffic-transformation#request-size-limits-overview" >}}) to prevent oversized requests from reaching upstream servers, thereby avoiding the unnecessary consumption of resources.

Expand Down
2 changes: 1 addition & 1 deletion tyk-docs/content/plan-your-api-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In this stage, Tyk streamlines deployment, whether on the cloud, on-premises, or

After deployment, Tyk offers robust tools to ensure smooth API operations and maintenance:
- **Real-Time Monitoring and Analytics**: [Tyk’s dashboard]({{< ref "tyk-dashboard" >}}) provides insights into API traffic, usage patterns, and error rates, enabling quick response to issues.
- **Dynamic Policy Management**: Set up and adjust security policies to control access and usage, such as [IP whitelisting]({{< ref "api-management/gateway-config-tyk-classic#ip-access-control" >}}), [request throttling]({{< ref "api-management/rate-limit#request-throttling" >}}), or [rate limiting]({{< ref "api-management/rate-limit" >}}).
- **Dynamic Policy Management**: Set up and adjust security policies to control access and usage, such as [IP whitelisting]({{< ref "api-management/gateway-config-tyk-classic#ip-access-control" >}}), [request throttling]({{< ref "api-management/request-throttling" >}}), or [rate limiting]({{< ref "api-management/rate-limit" >}}).
- **Plugin Support for Customization**: Use [Tyk’s plugin system]({{< ref "tyk-cloud#configure-plugins" >}}) to add custom functionality, such as [custom authentication]({{< ref "tyk-cloud#add-custom-authentication" >}}), or [traffic transformations]({{< ref "api-management/traffic-transformation#" >}}).

---
Expand Down
2 changes: 1 addition & 1 deletion tyk-docs/content/shared/create-security-policy-include.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To create a security policy with the Dashboard, follow these steps:

**Throttling**

When hitting quota or rate limits, you can automatically queue and auto-retry client requests. Throttling can be configured at a key or policy level. See [Request Throttling]({{< ref "api-management/rate-limit#request-throttling" >}}) for more details.
When hitting rate limits, you can set Tyk Gateway to automatically queue and auto-retry client requests. Throttling can be configured at a key or policy level. See [Request Throttling]({{< ref "api-management/request-throttling" >}}) for more details.

**Usage Quotas**

Expand Down
14 changes: 11 additions & 3 deletions tyk-docs/data/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,18 @@ menu:
path: /api-management/upstream-authentication
category: Page
show: True
- title: "Rate Limiting"
path: /api-management/rate-limit
category: Page
- title: "API Traffic Control"
category: Directory
show: True
menu:
- title: "Rate Limiting"
path: /api-management/rate-limit
category: Page
show: True
- title: "Request Throttling"
path: /api-management/request-throttling
category: Page
show: True
- title: "Security Policy and Access Keys"
path: /api-management/policies
category: Page
Expand Down
Loading