How do you speed up package installs across a fleet?
BeginnerProductionPerformance and Scale
Answer
Point hosts at an internal mirror or caching proxy (Artifactory, Nexus, apt-cacher-ng, a Pulp or Satellite repo) instead of the public internet. Use cache_valid_time for apt, install lists in one task, and bake common packages into the image.
With async the downloads happen in parallel, but a thousand hosts hitting one mirror at once will saturate it, so stagger with serial or throttle. Pin versions where repeatability matters, because unpinned installs can differ between runs a week apart.
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