How can I find which AWS API call is causing a "Rate exceeded" error?

Last updated: 2022-02-09

I receive a "Rate exceeded" error message when I try to create, update, or access an AWS service. How do I determine which AWS API call is causing the error?

Short description

To determine which API call is causing a Rate exceeded error in your AWS account, do the following:

1.    Create an Amazon Athena table for AWS CloudTrail logs.

2.    Run an Amazon Athena query to find the API call that's associated with the Rate exceeded error.

To troubleshoot the issue, see the To troubleshoot Rate exceeded errors based on the associated API call and AWS service section of this article.

Note: To log API activity in your AWS account, you must first create a trail in CloudTrail. Any data events that occur in your account before you create a trail aren't logged by the trail.

Resolution

Create an Amazon Athena table for CloudTrail logs

Create and run the Athena query to find the associated API call

1.    Open the Athena console.

2.    Choose the New query tab.

3.    Copy and paste the following example query into the query text box, and then choose Run query:

Important: 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;

4.    In the query output, identify the API calls listed in eventname and eventsource that are associated with the errorcode, "ThrottlingException".

To troubleshoot Rate exceeded errors based on the associated API call and AWS service

Note: Rate exceeded errors can occur with different throttling conditions, depending on the AWS service and API call that you're using.

Refer to the following troubleshooting documentation for the API call and service that's associated with the Rate exceeded error that you're receiving:

For GetResourceConfigHistory or ListDiscoveredResources API calls

See How can I 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 Auto Scaling API calls 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?

Note: 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.