Skip to main content
idle · gcp

Cloud Run services paying to keep minimum instances warm with no traffic

resource types
1
rule IDs covered
1
severity
medium

What does ZopNight detect here?

Cloud Run services are flagged when they pin one or more minimum instances yet `run.googleapis.com/request_count` shows effectively no traffic for 30 days. Google bills idle minimum instances for CPU and memory at the idle rate, so ZopNight prices the warm capacity from the service's vCPU and memory size and recommends scaling the minimum to 0.

Signal and threshold

How ZopNight evaluates Cloud Run services paying to keep minimum instances warm with no traffic.
Field Value
Rule IDsRC-149
Categoryidle
Severitymedium
Metricrun.googleapis.com/request_count
Thresholdmin instances 1 or more with request rate under 0.001
Evaluation window30d
SourceZopNight
Permissions usedrun.services.list · run.services.get · monitoring.timeSeries.list

Warm instances that nobody calls

Cloud Run normally scales to zero: an instance not handling requests becomes idle and is shut down. Setting a minimum keeps instances running anyway. Google’s minimum instances page notes that instances kept running this way incur billing costs, and the pricing page lists a separate idle rate per vCPU-second and GiB-second for them, adding that idle instances which are not minimum instances are not charged.

Minimums make sense for latency-sensitive services with steady traffic. On a service with no requests for a month, they are a standing charge for readiness nobody uses.

Checking a service’s minimum and its traffic

The minimum appears as a minScale annotation in the service YAML:

Terminal window
gcloud run services describe SERVICE --region=REGION --format=yaml | grep -i minscale

For traffic, chart run.googleapis.com/request_count for the service over 30 days in Metrics Explorer. Note that this metric counts only requests that reach the container, so requests rejected by IAM do not appear.

Conditions ZopNight checks

  1. The service’s minimum instance count is 1 or more.
  2. Request activity over the 30-day window averages below 0.001, effectively none.
  3. The service’s vCPU and memory size are known, along with live per-second Cloud Run rates for the region.
  4. The service has a known monthly cost.

When it declines to flag

With no request data at all, the rule stays silent rather than assuming no traffic. It also stays silent when the minimum is 0, when CPU or memory size cannot be read, or when either per-second rate is missing, because the idle charge cannot then be priced. Dev and test services that keep a minimum regardless of traffic are a separate check: Cloud Run Dev/Test Service Has Min Instances Above 0.

Pricing the idle warm capacity

Terminal window
saving = min instances x (vCPU x CPU rate per second + memory GiB x memory rate per second)
x 2,592,000 seconds per month
saving is capped at the service's current monthly cost

The 2,592,000 seconds is a 30-day month. Request-driven capacity is unchanged, because Cloud Run still scales up when traffic arrives.

Scaling the minimum to zero

  1. Confirm in the metric above that the service really sees no traffic.
  2. Set the service-level minimum to zero without a new revision: gcloud run services update SERVICE --region=REGION --min=0.
  3. If the minimum was set per revision, use --min-instances=0 instead, which deploys a new revision.
  4. Watch cold-start latency on the next real request and decide whether that is acceptable.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·