I receive a "Rate exceeded" error message when I try to create, update, or access an AWS service. I want to know what API call is causing this error.
Short description
To determine the API call that's causing the Rate exceeded error in your AWS account, create an Amazon Athena table for AWS CloudTrail logs. Then, run an Athena query to find the API call that's associated with the Rate exceeded error.
Note: To log API activity in your account, you must first create a trail in CloudTrail. Trails log data events in your account only after you create the trail.
Resolution
Create an Athena table for CloudTrail logs
For instructions, see Use the CloudTrail console to create an Athena table for CloudTrail logs.
Create and run the Athena query to find the associated API call
Complete the following steps:
-
Open the Athena console.
-
Choose the New query tab.
-
Enter the following example query into the query text box, and then choose Run query:
SELECT eventname, errorcode, eventsource, awsregion, useragent, COUNT(*) AS 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;
Note: Replace cloudtrail-table-name with your CloudTrail table name.
-
In the query output, find the records that have the ThrottlingException value in the errorcode field. The API calls in the eventname and eventsource fields are causing the Rate exceeded error.
Troubleshoot "Rate exceeded" errors for different API calls and AWS services
The Rate exceeded error can occur with different throttling conditions. The conditions depend on the AWS service and API call that you're using.
To troubleshoot the Rate exceeded error for the API call or AWS service that you're using, see the following AWS Knowledge Center articles.
Note: You can add a wait statement to AWS API calls so that they retry after they're throttled. For more information, see Retry behavior.
GetResourceConfigHistory or ListDiscoveredResources API calls
See How can I troubleshoot AWS Config console error messages?
PutMetricData API call
See How do I avoid throttling when I call PutMetricData in the CloudWatch API?
API calls for AWS Auto Scaling
See How do I keep my Auto Scaling API calls from being throttled?
API calls for an AWS Lambda function
See How do I troubleshoot Lambda function throttling with "Rate exceeded" and 429 "TooManyRequestsException" errors?
API calls for AWS Elastic Beanstalk
See How can I resolve API throttling or "Rate Exceeded" errors in Elastic Beanstalk?
Related information
How do I automatically create tables in Amazon Athena to search through AWS CloudTrail logs?