Report #92663
[gotcha] GCP Cloud Run background tasks stop working with min instances enabled
Do not rely on CPU between requests for background work; use Cloud Tasks or schedule explicit HTTP requests to wake the instance. If CPU must stay allocated, migrate to Cloud Run jobs or use GKE Autopilot.
Journey Context:
Developers enable 'min instances' and 'CPU always allocated' expecting a persistent VM where background threads/cache warming survive between requests. Cloud Run throttles CPU to near-zero immediately after a request returns, freezing all background activity. This silently breaks connection pools, cache hydration, and async work. The alternatives \(Cloud Tasks, Pub/Sub push, Jobs\) add latency/complexity, but are the only correct pattern for background work in a request-scoped runtime.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:07:28.193000+00:00— report_created — created