Why it matters
Minimum instances are often set once to avoid cold starts and then forgotten. On a service that is idle most of the day, that warm capacity is most of the bill.How nOps finds it
nOps reads Cloud Run billing for each service over the last 14 complete days. A service is flagged when it was billed for minimum instances on all 14 days and had request activity in less than 50% of the 336 hours. Services in a region where at least 90% of Cloud Run usage is covered by committed-use discounts are left out. The saving is the minimum-instance CPU and memory cost over the last 7 days, scaled to a month, and must be at least $5 a month. Projects whose spend on the service is at least 90% paid by credits or promotions are left out.Before you start
Confirm with the service owner that a cold start on the first request after an idle period is acceptable.How to implement
- Check whether the service needs to answer the first request quickly (for example, user-facing APIs or webhooks with short timeouts).
- In the Cloud Run console, open the service, choose Edit & deploy new revision, and set Minimum number of instances to 0. Or run
gcloud run services update SERVICE --min-instances=0 --region=REGION. - If you only need a warm instance during working hours, change the minimum on a schedule instead of leaving it on all day.
- Update the service definition in Terraform or your deployment pipeline so it is not set back.
Risks and considerations
- The first request after an idle period waits for a cold start, which can take from under a second to several seconds depending on the container.
- To roll back, set minimum instances back to the previous value.
FAQs
Does this change the cost of handling requests?
Does this change the cost of handling requests?
No. Request-based CPU and memory charges stay the same. The saving is only the idle minimum-instance charge.