How do I resolve the "Getting error Too Many Requests" error when I submit an AWS Batch job?
Last updated: 2020-02-21
My AWS Batch job failed, and I received the following error message: "Getting error Too Many Requests (Service: AWSBatch; Status Code: 429; Error Code: TooManyRequestsException)." How can I resolve this error?
Short Description
This error indicates that you reached your AWS Batch API limits. These limits typically apply to, but are not limited to, the DescribeJobs and SubmitJob API calls.
Consider the following:
- API limits don't apply to your account, but to AWS endpoints.
- AWS throttles all Amazon API requests for each AWS account on a per-Region basis. This prevents any one account from flooding the service endpoints with too many requests.
- AWS makes sure that all calls to all Amazon APIs don't exceed the maximum allowed API request rate. The maximum API request rate can vary across Regions.
You can receive this error when you:
- Submit multiple jobs at the same time programmatically, using the AWS Command Line Interface (CLI) or AWS SDKs
- Use AWS Lambda to submit jobs
Resolution
Consider the following solutions:
- Apply a retry strategy to your jobs using a job definition.
- Use retries and an exponential backoff algorithm with Jitter, and then resubmit your job.
- Avoid throttling by using AWS Batch array jobs to submit jobs with a single SubmitJob API call (up to 10,000 copies of a job).
Did this article help you?
Anything we could improve?
Need more help?