Speeding up Terraform caching with OverlayFS
summary
Uses OverlayFS to build a concurrent-safe provider cache by keeping a shared central lower (read-only) cache and giving each concurrent init its own upper (writable) dir, so inits never race writing the same files. Fetching and persisting providers are decoupled and persisting is deferred between plan and apply, cutting provider fetches to only cache misses. Results: typical pipelines see about a 10x speedup, big states go from hours to minutes and thousands of concurrent nightly plans finish in roughly an hour; implemented today with Atlantis, not yet a HashiCorp feature.
AI-written summary · about
chapters (8)
- 0:00Introduction and Speaker Background
- 0:40Understanding Terraform Operations
- 1:31Optimizing Terraform Performance
- 11:21Challenges with Terraform Provider Cache
- 11:47Implementing a Concurrent Safe Provider Cache
- 12:28OverlayFS: A Solution for Provider Cache
- 17:07Performance Improvements and Results
- 19:16Conclusion and Recommendations
