Google Cloud Run Memory Limit Calculator

Cloud Run gives each instance a single memory limit; an instance that exceeds it is shut down and its in-flight requests fail. How much memory an instance needs depends on how many requests it serves at once, and sizes above 4 GiB also need more vCPUs. This calculator sizes the limit from peak usage and adds the CPU Cloud Run requires for it.

01 Usage data

Enter observed per-instance usage directly, in MiB.

02 Workload profile

Advanced: margins and defaults

Values the result relies on that are our own defaults, or vendor defaults your setup may change. Each “?” says how one moves the result; the guide says where it comes from.

03 Sizing gauge

0 —

04 gcloud command

—

05 How this was derived

Enter usage data to see the calculation.

Memory limit, CPU and concurrency in short

Each instance gets one memory limit, 512 MiB by default, up to 32 GiB; an instance that exceeds it is terminated. The container's filesystem is in memory, so files it writes use the instance's memory too. Cloud Run docs

With no separate reservation and running out ending the instance, the calculator sizes the limit from the peak alone; the average doesn't change the result. The margin is MemoryLimit's own default; you can change it under Advanced.

Google's own formula counts requests: standing memory plus memory per request times concurrency. The calculator applies it when you enter the instance's idle memory and the concurrency now and planned. Up to 4 GiB it leaves CPU at the default 1 vCPU; above that it adds the fewest vCPU the memory needs. Cloud Run docs

Common input mistakes

  • Using the utilization metric as if it were MiB: we read it as a share of the instance's current limit, so multiply its p99 by that limit to get the peak in MiB.
  • Planning a higher concurrency without entering the idle memory: the whole peak counts as per-request memory, so the result is an upper bound.
  • A measured peak taken with fewer requests in flight than the maximum concurrency you entered: memory per request, and the planned memory, come out low.

Full derivation, warnings and every assumption: how the Cloud Run calculator works. The shared formula and margin tables: the sizing model.

Related calculators: