CPU allocation timeout during cold start when scaling from zero
0 reputation · 07 Apr 2026, 01:32 UTC
When optimizing a low-traffic workload on Cloud Run, setting min-instances to 0 and selecting "CPU allocated only during request processing" is the standard approach to eliminate idle costs. However, this configuration introduces a specific risk during the transition from zero to one active instance.
If a container requires a heavy initialization phase—such as loading large libraries into memory or establishing remote connection pools—the CPU is only active once the first request is received. There is a concern that the initialization logic exceeds the request timeout period or suffers from extreme throttling before the instance is fully ready.
Does Cloud Run guarantee a minimum CPU burst during the container startup phase when CPU is only allocated during requests? Furthermore, is there a documented configuration to ensure background initialization completes without triggering a request timeout without reverting to always-allocated CPU?