xargs
to simulate a burst that exceeds our configured limit (5 requests per 10 seconds).
<replace-with-key-id>
with the API Key ID you saved earlier:
HTTP/1.1 200 OK
, and other requests failing with HTTP/1.1 429 Too Many Requests
as the rate limit is immediately enforced. The order of 200s
vs 429s
might vary depending upon the processing time, but you will see immediate rejections once the limit is hit.
Request Throttling Policy
Throttling
Disable Throttling
checkbox3
into the Throttle retries (or connection attempts) field5
into the Per (seconds): fieldHTTP/1.1 200 OK
quickly429
. Instead, you should observe a delay before their status lines appearthrottle_interval
), Tyk will retry the queued requests. Some might now succeed (return 200 OK
) if the rate limit window allowsthrottle_retry_limit
(3) times and still encounters the rate limit, then it will finally return HTTP/1.1 429 Too Many Requests
200 OK
responses compared to the previous test, and any 429
responses will appear significantly laterthrottle_interval
: Defines the wait time (in seconds) between retry attempts for a queued request. (Note: Do not set it to 0
. If you do, no delay is applied, and the request is immediately retried. This will creates a “busy waiting” scenario that consumes more resources than a positive interval value)throttle_retry_limit
: Sets the maximum number of retry attempts before the request is rejected. (Note: Do not set it to 0
. Setting it to 0
means that there will be no throttling on the request)0
.
-1
and means it is disabled by default.
Setting throttle_interval
and throttle_retry_limit
values to any number smaller than 0
, to ensure the feature is diabled.
You can configure these settings using either the Tyk Dashboard UI or the Tyk Dashboard API.
GET /api/portal/policies/{POLICY_ID}
throttle_interval
and throttle_retry_limit
fields within the policy JSON objectPUT /api/portal/policies/{POLICY_ID}
with the modified object, or create a new one using POST /api/portal/policies/
429 Too Many Requests
error (which is the default rate-limiting behaviour), the Gateway temporarily holds them in a queue. After waiting for a specified duration (throttle_interval
), Tyk attempts to process the request again, re-checking the rate limit status.
This retry cycle repeats until either the request can be successfully processed (if capacity becomes available) or a configured maximum number of retries (throttle_retry_limit
) is reached. Only after exhausting all retries does Tyk return the 429
error to the client.
Think of it like trying to access a service with a restriction on how many people can enter per minute (Rate Limit). If you arrive when the per-minute limit is full, standard behaviour is to turn you awa
y immediately. With Throttling enabled, the service instead asks you to wait briefly (the interval) and tries your entry again shortly, checking if the rate limit has freed up capacity, repeating this a f
ew times (the retry limit) before finally turning you away if access is still restricted.
What is Request Throttling in Tyk?
How does Request Throttling differ from Rate Limiting?
Does Request Throttling work with Request Quotas?
How do I configure Request Throttling in Tyk?
How does Request Throttling affect response times?
ThrottleInterval
between retry attempts. The maximum additional latency would be ThrottleInterval × ThrottleRetryLimit
seconds. This trade-off provides better success rates at the cost of potentially longer response times for some requests.Can I monitor throttled requests in Tyk?
ThrottledRequestsPS
(throttled requests per second) metric to see how often requests are being throttled. Additionally, when a request is throttled, Tyk emits a RateLimitExceeded
event that can be captured in your monitoring system.Is Request Throttling enabled by default?
ThrottleRetryLimit
to a value greater than 0 and configure an appropriate ThrottleInterval
. These settings can be applied through policies or directly in access keys.