I've spent two weeks optimizing my CI/CD CodePipeline and have made significant improvements. Initially, my build times dropped from about 7-10 minutes down to 1-2 minutes. But now, I'm facing a frustrating issue where the CodeBuild containers take at least 5 minutes to provision before anything even starts running. I'm working with an nx monorepo and utilizing the nx build cache system with S3 as the backend, alongside the native S3 cache for CodeBuild jobs and ECR container caching. Despite my optimizations, I'm seeing build times extend again to 7-13 minutes. What might be causing this delay?
3 Answers
I’m curious about the instance types you’re using for your runners. Sometimes the delays come from waiting for the instance to provision. If you’re on BUILD_GENERAL1_MEDIUM, it might be worth checking if that’s still adequate for your needs.
Have you considered that your cache might be getting too large? CodeBuild handles the cache as one big blob when moving it in and out of S3, which can slow things down. In my experience, caching npm packages can often take longer than just installing directly from npm, especially if your cache isn’t really speeding things up.
It sounds like CodeBuild can be pretty slow to provision sometimes, that’s just the nature of it. Not much else to say there really. Maybe the instance type you’re using could be affecting the performance too? What are you currently running?

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically