How do you deal with cloud API rate limits when running cloud modules at scale?
IntermediateProductionPerformance and Scale
Answer
Reduce calls, then slow down the rest. Use filters and caching in inventory, prefer modules that handle several resources, and avoid per-host cloud calls when one run_once call returns all data. Add throttle, until/retries/delay with backoff for throttling errors (RequestLimitExceeded, HTTP 429), and spread work with serial.
For AWS, set AWS_MAX_ATTEMPTS and AWS_RETRY_MODE=adaptive so botocore retries with backoff. If many jobs use the same account concurrently, stagger the schedules.
More on Performance and Scale
Why can Ansible be slower than a shell script for 100 servers, and what dominates the time?BeginnerHow do you choose the `forks` value?BeginnerWhat is SSH pipelining and why does it help?BeginnerWhich SSH settings matter for performance and stability?IntermediateHow do you find out which tasks are slow?BeginnerHow do you reduce the cost of fact gathering?Intermediate