What setting min-instances does on Cloud Run, how it is billed under request-based and instance-based billing, why Google suggests three for availability, and how process allocation changes how many instances you need to keep warm.

A Cloud Run service scales to zero by default, which is why its first request after a quiet stretch is slow. Setting min-instances keeps warm instances around, and the cost of that choice depends on how the service is billed and how many services you have.
This guide covers what the setting does, what it costs and how to decide on a number.
Per the Cloud Run documentation on minimum instances, Cloud Run removes idle instances by default, and with a minimum set it keeps at least that many running even when they are not processing requests. Active instances count toward the minimum, so with a minimum of 10 and 6 busy instances, 4 stay idle, and above the minimum the service scales as before.
The page also lists what the setting does not promise. Minimum instances are a best-effort target, instances can be restarted at any time, and a container that crashes on startup or fails health checks leaves the number of ready instances below the floor. For availability, Google recommends at least three.
Billing follows the modes on the Cloud Run pricing page, summarized below.
Under request-based billing a warm idle instance is cheap but not free, so a service with one minimum instance pays for that instance all month. Under instance-based billing the instance is billed at the full rate whenever it is running, which makes minimum instances close to a fixed cost, and Google suggests committed use discounts for that case. Check the current rates on the Cloud Run pricing page before you decide, since they change by region.
# One warm instance for steady low traffic
gcloud run services update api --region=europe-west1 --min-instances=1
# Three for high availability, with extra CPU while containers start
gcloud run services update api --region=europe-west1 --min-instances=3 --cpu-boost
Apply the setting at the service level, as Google recommends, and avoid combining service-level and revision-level minimums, since the two interact in ways that are easy to misread. A revision that serves a percentage of traffic during a rollout can otherwise keep more instances warm than you expect.
It fixes cold starts caused by scaling from zero and does nothing for cold starts during a traffic surge, where new instances beyond the minimum still start cold. For those, startup CPU boost and a faster container start matter more, as covered in Cloud Run cold starts. It also multiplies by the number of services: ten services with a minimum of one each is ten always-on instances, and splitting an app into many small Cloud Run services makes the warm-instance bill grow with each split.
Encore brings infrastructure from code, and a multi-service backend does not have to be a fleet of Cloud Run services. Per the infrastructure configuration docs, process allocation lets you deploy all services in one process or one process per service, chosen per environment in the Platform Dashboard without code changes. With everything in one process, one Cloud Run service and its minimum instances cover every service, and calls between services are function calls.

Run in your terminal to get started locally.
Two services written as separate code, which can run in one process in staging and in separate processes in production:
// catalog/catalog.ts
import { api, APIError } from "encore.dev/api";
interface Product {
sku: string;
name: string;
priceCents: number;
}
const products: Record<string, Product> = {
"tee-black": { sku: "tee-black", name: "Black tee", priceCents: 2400 },
"cap-navy": { sku: "cap-navy", name: "Navy cap", priceCents: 1800 },
};
export const get = api(
{ expose: false, method: "GET", path: "/catalog/:sku" },
async ({ sku }: { sku: string }): Promise<Product> => {
const product = products[sku];
if (!product) throw APIError.notFound("unknown sku");
return product;
},
);
// storefront/storefront.ts
import { api } from "encore.dev/api";
import { catalog } from "~encore/clients";
export const quote = api(
{ expose: true, method: "GET", path: "/quote/:sku/:quantity" },
async ({ sku, quantity }: { sku: string; quantity: number }): Promise<{ totalCents: number }> => {
const product = await catalog.get({ sku });
return { totalCents: product.priceCents * quantity };
},
);
With all services in one process, the call from storefront to catalog does not leave the instance, and a single warm instance serves both. In production you can switch to a process per service from the dashboard when the services need to scale separately, per the same configuration docs. The deploy also leaves manual changes in the Cloud Run console alone, since the platform updates only what it needs to and checks for drift before changing a resource, so a min-instances value you set with gcloud is not overwritten by the next deploy. The GCP infrastructure docs describe the Cloud Run settings the platform manages.
To deploy, connect your GCP project as described in Connect your cloud account and push with git push encore. Locally, encore run starts all services together.
A coding agent that splits a service in two does it in code and leaves the process layout to the environment, so it does not change the number of Cloud Run services you pay to keep warm.
Best fit: Teams on Cloud Run with several small services who want one warm instance to cover them, with the option to split them in production later.
Start at zero for internal tools and anything that tolerates a slow first request, move user-facing services to one, and use three where a restart should never leave the service without a ready instance. Review the idle instance cost after a month, since it shows up as a flat line in the bill.
It keeps at least that many container instances running even when they are not processing requests, so the first request after a quiet period reaches a warm instance instead of waiting for a cold start. Instances above the minimum scale up and down as usual.
Yes. Under request-based billing, idle minimum instances are billed at a lower rate, and with min-instances at 0 you are not billed while idle. Under instance-based billing, you pay the full rate for the whole instance lifecycle, with or without minimum instances.
One removes cold starts for steady low traffic, and Google recommends at least three for high availability, since minimum instances can be restarted at any time. Services that can tolerate an occasional cold start can stay at zero.
Run related services in one process so there is one Cloud Run service to keep warm instead of many. With Encore, process allocation deploys all services together or one per service, chosen per environment in the Platform Dashboard with no code changes.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.