How do I prevent "rate exceeded" ThrottlingException errors when I run monitoring scripts in Amazon EMR?

2 minute read
0

To monitor my Amazon EMR clusters, I run scripts that make API calls. The scripts return errors similar to the following: "Rate exceeded (Service: AmazonElasticMapReduce; Status Code: 400; Error Code: ThrottlingException; Request ID: e2b6191c-gkl5-269r-u735-cryyz251a837)" How do I prevent "rate exceeded" errors?

Short description

Amazon EMR throttles API calls to maintain system stability. Throttling exceptions usually occur when you run monitoring scripts at regular intervals to check clusters for a parameter. Here's an example: calling DescribeCluster every 60 seconds to check if the cluster has reached the WAITING state. The more clusters that you have and the more monitoring scripts that you run, the more likely you are to get throttling errors.

Resolution

To prevent throttling errors:

  • Reduce the frequency of the API calls.
  • Stagger the intervals of the API calls so that they don't all run at the same time.
  • Implement exponential backoff when making API calls.
  • Consider moving to an event-based architecture.

To understand the source of throttling errors, use AWS CloudTrail to track Event History. CloudTrail can help identify event details such as the following:

  • Frequent API calls
  • Rate exceeded errors and their related API calls
  • Whether API calls are triggered by users or automation

Related information

Common errors

Managing and monitoring API throttling in your workloads

How CloudTrail works

AWS OFFICIAL
AWS OFFICIALUpdated a year ago