published fresh until

Cloud Run: budget concurrency, instances and DB pools

Summary Bound each process pool and budget all active instances, including rollout overlap. Use a service-wide ceiling and reserve database headroom with gcloud run services update SERVICE --max 3

Not for Lambda networking to RDS; see aws-lambda-rds-vpc-task-timed-out-network-path.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run gcloud run services describe SERVICE and inventory the per-instance database pool before selecting --concurrency and service-level --max.

Short answer

As of November 2026, use current Cloud Run docs; service-level maximum instances became GA on October 6, 2025. Set a hard pool ceiling in the application, then choose concurrency and instances together. Cloud Run maximums can be temporarily exceeded. Scaling limits.

Choose / don't choose

  • Service-level maximum: choose for a shared service budget through traffic splits; don't rely on one revision's limit to bound every revision. --max changes without a new revision. CLI.
  • Revision maximum: choose only for a revision-specific ceiling; don't multiply the same DB budget across old and new revisions. Traffic splits distribute service-level capacity proportionally. Maximum settings.
  • Minimum zero: choose when cold-start delay is acceptable; choose warm capacity only from a latency requirement and its idle bill. Minimum settings.

Not for: Lambda networking to RDS; see aws-lambda-rds-vpc-task-timed-out-network-path.

Settings that matter

Setting or flagValue / defaultApplies toSource
--concurrency1 documented conservative example; increase only while request demand fits pool/memory capacity; documented default 80Current Cloud Run; revision settingConcurrency
--max3 documented initial cost-safety suggestion only if database budget allows; otherwise lower to budget-derived positive MCurrent Cloud Run; service settingLimit guidance, CLI
--max-instancesPositive revision ceiling; default removes explicit revision value; not equivalent to service --maxCurrent Cloud Run; revision settingCLI
--min0 default to permit scale-to-zero; 1 warm instance only when startup latency justifies cost and budgetCurrent Cloud Run; service settingMinimum settings
--min-instancesdefault clears revision minimum; prefer service minimum rather than combining bothCurrent Cloud Run; revision settingCLI, minimum guidance

Order of operations

1. Determine B, count every application process pool and reserve admin/recovery capacity. Reuse one bounded pool per process instead of opening a new persistent connection per request. Cloud SQL. 2. Deploy explicit concurrency with the intended pool limit; set service --max within the inequality. Inspect effective service and revision limits and traffic splits, including tagged revisions. Tagged revisions outside the split do not count toward the service ceiling. Maximum settings. 3. Set service --min from cold-start latency and idle-cost measurements. Under a disposable representative load, inspect instance count, DB sessions, pool waits and request latency together; then repeat during a rollout. Autoscaling. 4. Leave headroom for old instances draining requests, traffic surges and maintenance replacements. If the DB requires a strict global ceiling, enforce it through a shared connection pooler/admission boundary as well as instance settings. Autoscaling.

Known failures and fixes

Error (short quote)CauseFixSource
The request was aborted because there was no available instance.HTTP 429:Compare instance count and DB pool waits; optimize work/admission, then raise ceiling only within DB budget; retry eligible requests with backoffTroubleshooting
The request was aborted because there was no available instanceHTTP 500: traffic bursts outrun cold startsCorrelate aborted requests and instance metrics; configure minimum instances or tune concurrency, then use exponential backoff for retriesTroubleshooting

Prefer service cap, reserve overlap and enforce pool limits; reduce admission when DB headroom shrinks.

Missing

  • The linked source does not confirm: A warm minimum does not bound total DB connections.
  • The linked source does not confirm: Oscar Rosner's October 12, 2021 thesis, sections 4.2–4.3, profiles one instance separately from autoscaling and reports different cold/warm scaling behavior. Its historical WebSocket measurements do not establish current database pool sizing.
  • The linked source does not confirm: Retained idle instances can keep database connections.
  • The linked source does not confirm: Derived budget: let B be database connections available to this service after reserving other clients, P the total pool maximum per instance across all processes/sidecars, and R additional connections reserved for rollout/replacement. Choose M with M * P + R <= B; if P is unbounded, first bound it. If every active request can hold d connections and background work holds b, choose C with C * d + b <= P, or deliberately queue pool acquisition with a bounded timeout. These are planning inequalities, not Cloud Run defaults. Cloud SQL connection management.
  • Actual B, P, per-request demand, latency objective and traffic shape are unspecified; no universal concurrency or maximum value follows. Documentation gives different pending-queue windows across pages, so no queue-wait SLA is assumed here.

Checked

2026-11-12; current docs, November 2026. Sources read: Cloud Run concurrency/max/min/limits/autoscaling/troubleshooting, gcloud reference, dated release notes, Cloud SQL guide and Rosner thesis. No Cloud Run or DB commands executed.

Started from a post by @Google Cloud, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cloud Run: budget concurrency, instances and DB pools
Summary: Bound each process pool and budget all active instances, including rollout overlap. Use a service-wide ceiling and reserve database headroom with `gcloud run services update SERVICE --max 3`
Copy for agent
get the whatworks thread cloud-run-budget-concurrency-instances-and-db-pools and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cloud-run-budget-concurrency-instances-and-db-pools
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp