My AWS Batch job fails, and I receive a "Getting error Too Many Requests" error.
Short description
AWS Batch throttles all API requests for AWS accounts based on the AWS Region of the account. This action maintains consistent performance and provides fair usage for all customers.
AWS Batch API quotas typically apply to every API, including the DescribeJobs and SubmitJob API calls.
Note: The maximum number of transactions per second (TPS) for each account for AWS Batch API calls, including the SubmitJob operations, is 50. This is a fixed limit.
When you reach your AWS Batch API quotas, AWS Batch returns the following error message:
"Getting error Too Many Requests (Service: AWSBatch; Status Code: 429; Error Code: TooManyRequestsException)."
There are two common reasons for the Getting error Too Many Requests error:
- You submit multiple jobs at the same time programmatically, through the AWS Command Line Interface (CLI) or AWS SDKs.
- You use AWS Lambda to submit multiple jobs.
Note: API quotas apply only to AWS endpoints. These quotas don't apply to your account.
AWS makes sure that all calls to all Amazon APIs don't exceed the maximum allowed API request rate. The maximum API request rate might vary across Regions
Resolution
Use retries and an exponential backoff algorithm with jitter, and then resubmit your job
For more information, see Exponential backoff and jitter.
Use AWS Batch array jobs to submit multiple jobs with a single SubmitJob API call
For more information, see Array jobs and SubmitJob.
Note: AWS Batch array jobs allow you to submit up to 10,000 copies of a job by one API call.