How can I find which API call is causing the "Rate exceeded" error?
Last updated: 2020-03-18
I received the error "Rate exceeded" creating, updating, or accessing an AWS service, but I don't know which API call is causing this error.
Resolution
Use AWS CloudTrail to create a table for CloudTrail logs, and run an Amazon Athena query to find the API call associated with the "Rate exceeded" error. Then, follow these instructions to troubleshoot the "Rate exceeded" throttling error for the AWS API call.
Create and run the Athena query to find the AWS API call
1. Open the CloudTrail console.
2. Follow the instructions to create a CloudTrail trail.
3. Follow the instructions to create a table for a CloudTrail trail.
4. Open the Athena console, and choose the New query tab.
5. Copy and paste the following example query, and then choose Run query.
Note: Replace cloudtrail-table-name with the name of your CloudTrail table.
select eventname, errorcode,eventsource,awsregion, useragent,COUNT(*) count
FROM cloudtrail-table-name
where errorcode = 'ThrottlingException'
AND eventtime between '2018-10-14T03:00:08Z' and '2018-10-23T07:15:08Z'
group by errorcode,awsregion, eventsource, useragent, eventname
order by count desc;
6. In the query output, note the API calls listed in eventname and eventsource associated with the errorcode "ThrottlingException".
Troubleshoot the "Rate exceeded" throttling error for the AWS API call
The "Rate exceeded" error can occur with different throttling conditions depending on the AWS service and API call. Refer to the following troubleshooting documentation for your API call and AWS service.
- For GetResourceConfigHistory or ListDiscoveredResources API calls, follow the instructions to troubleshoot AWS Config console error messages.
- For the PutMetricData API call, see How do I avoid throttling when I call PutMetricData in the CloudWatch API?
- For API calls related to AWS Auto Scaling, see My API calls to AWS Auto Scaling are getting throttled. What can I do to avoid this?
- For API calls related to an AWS Lambda function, see How do I troubleshoot Lambda function throttling with "Rate exceeded" and 429 "TooManyRequestsException" errors?
- For API calls related to AWS Elastic Beanstalk, see How can I resolve API throttling or "Rate Exceeded" errors in Elastic Beanstalk?
- You can also allow AWS API calls to retry after throttling occurs by adding a wait statement. For more information, see Error Retries and Exponential Backoff in AWS.
Related Information
Did this article help you?
Anything we could improve?
Need more help?