Deploy a containerized service to Google Cloud Run with tuned concurrency and minimized cold-start latency

domain: gcp-cloud-run · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Build and push your container image to Artifact Registry (preferred) or Container Registry; ensure the image listens on the PORT environment variable (Cloud Run injects this, default 8080)
  2. Deploy with gcloud run deploy specifying --concurrency (requests per container instance, up to 1000), --min-instances to keep warm instances alive and eliminate cold starts for latency-sensitive services, and --max-instances to cap cost
  3. Set --cpu and --memory according to your workload; note that CPU is throttled to near-zero between requests unless you pass --no-cpu-throttling (which keeps CPU allocated during idle — incurs cost)
  4. Use --execution-environment=gen2 for workloads needing full Linux compatibility or higher networking performance; gen2 also reduces cold-start frequency
  5. Configure startup and liveness probes via the service YAML (httpGet or tcpSocket) so Cloud Run can distinguish a slow start from a crashed container; set initialDelaySeconds to match your application boot time
  6. Set environment variables and secrets via --set-env-vars or --set-secrets (binds Secret Manager secrets at deploy time); avoid baking credentials into the image

Known gotchas

Related routes

Ship a zero-downtime rolling deploy on Kubernetes
kubernetes · 4 steps · unrated
Set up BigQuery CDC via Datastream to replicate Postgres or MySQL changes continuously
cloud.google.com · 6 steps · unrated
Deploy a containerized application to AWS ECS Fargate with health checks and rolling update configuration
aws-ecs · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans