How can I troubleshoot "429 Too Many Requests" or "Limit Exceeded" errors for my API Gateway API?
I received "429 Too Many Requests" or "Limit Exceeded" errors when sending requests to my Amazon API Gateway API. How do I troubleshoot these errors?
"I received "429 Too Many Requests" or "Limit Exceeded" errors when sending requests to my Amazon API Gateway API. How do I troubleshoot these errors?Short descriptionAPI Gateway has account-level quotas, per Region. The throttle quota is 10,000 requests per second (RPS) with an additional burst capacity provided by the token bucket algorithm. The maximum bucket capacity is 5,000 requests per account and Region. API Gateway throttling-related settings are applied in the following order:Per-client or per-method throttling limits that you set for an API stage in a usage plan.Per-method throttling limits that you set for an API stage.Account-level throttling per Region.AWS Regional throttling.Exceeding the throttling limit or quota returns a "429 Too Many Requests" or "Limit Exceeded" error response.For more information, see How throttling limit settings are applied in API Gateway.ResolutionBefore you begin, make sure that you have followed the instructions to turn on Amazon CloudWatch Logs for troubleshooting API Gateway. Make sure that you choose ERROR to generate execution logs only for requests to your API that result in an error. Then, view logged API requests and responses using the CloudWatch console."429 Too Many Requests" errorCheck the rate or burst limit for per-client or per-method throttling limits that you set for the API stage for your usage plan. When the rate or burst limits are exceeded, CloudWatch execution logs an exceeded throttle limit error similar to the following:(f277a0b4-2bcd-41b3-8e43-4de770663ffb) API Key **********************************F0yrv6 exceeded throttle limit for API Stage rohkz08x02/dev: Key throttle limit exceeded for Usage Plan ID nnpegc, RestApi rohkz08x02, Stage dev, Resource f646q2, HttpMethod GET. Limit: 5.00 Burst: 10To resolve this error, use retries and an exponential backoff algorithm with jitter, and then resubmit your API request.For more information, see exponential backoff and jitter."Limit Exceeded" errorThis error might indicate that the quota limit is exceeded for your API Gateway usage plan. When the quota limit is exceeded, then CloudWatch execution logs an exceeded quota limit error similar to the following:(7b819c41-e0a0-433a-883e-bc461fd70fd6) API Key **********************************F0yrv6 exceeded quota limit for API Stage rohkz08x02/dev: Key quota exhausted for Usage Plan ID nnpegc. QLimit: 500 Period: DAYTo resolve this error, follow the instructions to extend the remaining quota.Related informationHow do I troubleshoot Lambda function throttling with "Rate exceeded" and 429 "TooManyRequestsException" errors?How do I find API Gateway REST API errors in my CloudWatch logs?Follow"