RequestLimitExceeded
This error occurs when your account exceeds the allowed rate of API requests for Amazon EC2 or other control plane operations.
Usually happens because:
- ☑ Custom monitoring scripts poll status endpoints repeatedly without delay intervals
- ☑ Large-scale automation tools hit EC2 control plane endpoints concurrently
- ☑ Default SDK configuration limits are too low, causing immediate failures
🔍 Quick Checklist:
What is RequestLimitExceeded?
A 'RequestLimitExceeded' error is returned by Amazon EC2 (and other AWS services) when the rate of API calls (such as DescribeInstances, DescribeVolumes, or RunInstances) exceeds the service's API request quota. AWS enforces token bucket algorithms to limit control plane call rates, preventing system overloading. If client loops query status rapidly without backoff, the request limits are exhausted.
Common Causes
- Aggressive polling loops: Custom monitoring scripts or script loops call 'DescribeInstances' or resource status queries repeatedly without pause.
- High concurrency deployments: Orchestrators (like Kubernetes cluster autoscalers or Terraform runs) query EC2 resources concurrently across multiple threads.
- Unconfigured SDK retry behaviors: Client SDK clients do not utilize exponential backoff retry handlers, raising exceptions immediately.
| Cause | Frequency |
|---|---|
| Aggressive loops polling resource statuses without sleep intervals | ⭐⭐⭐⭐⭐ |
| High concurrent queries from large infrastructure orchestrators (Autoscalers) | ⭐⭐⭐⭐ |
| Default client SDK settings lacking exponential backoff overrides | ⭐⭐⭐ |
Common Mistakes
- Writing infinite status checking loops without sleep timers, exhausting API credits in seconds.
- Assuming that request limit failures indicate instance availability limits.
How to Fix
AWS Operations & Verification
Increase retry limits and enforce the standard retry mode (which supports exponential backoff) inside the AWS configuration file.
[default]
region = us-west-2
# Enforce the newer 'standard' or 'adaptive' retry mode
retry_mode = standard
# Increase max retry attempts threshold
max_attempts = 10Platform Specific Fixes
Override retry parameters in Linux shell sessions using environment variables.
# 1. Enforce standard retry modes globally
export AWS_RETRY_MODE=standard
# 2. Enforce retry maximum limits threshold
export AWS_MAX_ATTEMPTS=8Best Practices
- Configure client applications to cache slow-changing API metadata locally.
- Adopt AWS CloudWatch alarms to track AWS API call volumes metrics.
Frequently Asked Questions (FAQ)
Q: What is a RequestLimitExceeded error?
This is an API rate-limiting error. AWS limits how fast you can call control plane APIs (like describing instances or creating volumes). If you exceed the allowed request rate, AWS throttles your client with this error.
Q: How is this different from service quota limits?
Service quotas limit the number of resources you can have (e.g. max 20 EC2 instances). 'RequestLimitExceeded' limits the rate of API actions you can perform per second (e.g. max 100 DescribeInstances calls per second).
Q: How do I solve this in my scripts?
Always implement exponential backoff with jitter. Instead of retrying failed requests immediately, wait for a short duration, then double the wait time for subsequent retries, and add random microsecond offsets (jitter) to prevent client synchronization spikes.
Q: Does the AWS SDK auto-retry these errors?
Yes, modern AWS SDKs have built-in retry handlers that automatically catch RequestLimitExceeded and retry with exponential backoff. However, you can configure or increase the maximum retry limit (e.g. setting 'max_attempts' to 10 in your AWS config file).