DevOps / Ansible Interview questions
How can you optimize a large-scale Ansible deployment for performance?
- Raise forks well above the default to match available control-node CPU/network capacity, so more hosts run truly in parallel.
- Enable persistent fact caching (Redis or similar) so a large inventory doesn't re-gather facts on every single run.
- Use the free strategy for independent hosts so faster hosts aren't bottlenecked waiting for the slowest host on every task.
- Enable SSH pipelining and connection reuse (ControlPersist) to cut per-task SSH connection overhead significantly at scale.
- Split very large inventories into batches with serial, so a single run doesn't try to open thousands of simultaneous connections at once.
- Move to Execution Environments / Ansible Automation Platform for scheduling, job isolation, and horizontal scaling of control-node capacity itself when a single control node becomes the bottleneck.
At large scale, the bottleneck is usually connection and fact-gathering overhead multiplied across thousands of hosts rather than task logic itself, so most of these optimizations target reducing per-host overhead and increasing safe parallelism rather than rewriting playbooks.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
