Configure memory limits for worker pools Stay organized with collections Save and categorize content based on your preferences.
Preview — Cloud Run worker pools
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
You can choose the amount of memory to provide for your Cloud Runworker pool. This page describes how to specify the amount of memoryavailable for your worker pool.
Understand memory usage
Cloud Run instances that exceed their allowed memory limit areterminated.
The available memory for your instance needs to be sufficient for:
- Running the worker pool executable, because the executable must be loaded tomemory
- Allocating memory in your worker pool process
- Writing files to the file system
The size of the deployed container image does not affect memory that is availablefor the instance.
Set and update memory limits
You can set memory limits on Cloud Run worker pools.By default, the memory allocated to each worker pool is512 MiB.
Required memory when setting a CPU value
When setting a CPU value, the following memory is required:
| CPUs | Memory required |
|---|---|
| 1 vCPU | 128 MiB to 4 GiB |
| 2 vCPU | 128 MiB to 8 GiB |
| 4 vCPU | 2 to 16 GiB |
| 6 vCPU | 4 to 24 GiB |
| 8 vCPU | 4 to 32 GiB |
Maximum amount of memory
The maximum amount of memory you can configure is32 gibibyte (32 Gi).
Minimum memory
The minimum memory setting is 512 MiB.
Required roles
To get the permissions that you need to configure and deploy Cloud Run worker pools, ask your administrator to grant you the following IAM roles:
- Cloud Run Developer (
roles/run.developer) on the Cloud Run worker pool - Service Account User (
roles/iam.serviceAccountUser) on the service identity
For a list of IAM roles and permissions that are associated withCloud Run, seeCloud Run IAM rolesandCloud Run IAM permissions.If your Cloud Run worker pool interfaces withGoogle Cloud APIs, such as Cloud Client Libraries, see theservice identity configuration guide.For more information about granting roles, seedeployment permissionsandmanage access.
Configure memory limits
Any configuration change leads to thecreation of a new revision. Subsequent revisions will also automatically getthis configuration setting unless you make explicit updates to change it.
You can set memory limits for a Cloud Run worker pool using theGoogle Cloud console, Google Cloud CLI, YAML, or Terraform:
Console
In the Google Cloud console, go to Cloud Run:
SelectWorker pools from the menu, and clickDeploy container toconfigure a new worker pool.If you are configuring an existing worker pool, click theworker pool, then clickEdit and deploy new revision.
If you are configuring a new worker pool, fill out the initial workerpool page, then clickContainer(s), Volumes, Networking, Security to expand theworker pools configuration page.
Click theContainer tab.

- Select the memory size from theMemory list.
ClickCreate orDeploy.
gcloud
You canupdate the memory allocationof a given worker pool by using the following command:
gcloudbetarunworker-poolsupdateWORKER_POOL--memorySIZE
Replace the following:
- WORKER_POOL: the name of your worker pool
- SIZE: a memory size from theCPU and memory table.The format for size is a fixed or floating point number followedby a unit:
GorMcorresponding to gigabyte or megabyte,respectively, or use the power-of-two equivalents:GiorMicorresponding to gibibyte or mebibyte respectively.
You can also set memory limits duringdeployment using the command:
gcloudbetarunworker-poolsdeploy--imageIMAGE_URL--memorySIZE
Replace the following:
- IMAGE_URL: a reference to the container image thatcontains the worker pool, such as
us-docker.pkg.dev/cloudrun/container/worker-pool:latest. - SIZE: a memory size from theCPU and memory table.The format for size is a fixed or floating point number followed by a unit:G or M corresponding to gigabyte or megabyte, respectively, or use thepower-of-two equivalents: Gi or Mi corresponding to gibibyte or mebibyterespectively.
YAML
If you are creating a new worker pool, skip this step.If you are updating an existing worker pool, download itsYAML configuration:
gcloudbetarunworker-poolsdescribeWORKER_POOL--formatexport>workerpool.yamlThe following example contains the YAML configuration:
apiVersion:run.googleapis.com/v1kind:WorkerPoolmetadata:name:WORKER_POOLannotations:run.googleapis.com/launch-stage:BETAspec:template:spec:containers:-image:IMAGE_URLresources:limits:memory:SIZE
Replace the following:
- WORKER_POOL: the name of your Cloud Run worker pool.
- IMAGE_URL: a reference to the container image thatcontains the worker pool, such as
us-docker.pkg.dev/cloudrun/container/worker-pool:latest. - SIZE: the chosen memory size.The format is a fixed or floating point number followed by a unit:
GorMcorresponding to gigabyte or megabyte,respectively, or use the power-of-two equivalents:GiorMicorresponding to gibibyte or mebibyte respectively.
Create or update the worker pool using the following command:
gcloudbetarunworker-poolsreplaceworkerpool.yaml
Terraform
To learn how to apply or remove a Terraform configuration, seeBasic Terraform commands.
resource"google_cloud_run_v2_worker_pool""default"{name="WORKER_POOL"location="REGION"launch_stage="BETA"template{containers{image="IMAGE_URL"resources{limits={memory="SIZE"}}}}}Replace the following:
- WORKER_POOL: the name of the worker pool.
- REGION: the Google Cloud region. For example,europe-west1.
- IMAGE_URL: a reference to the container image thatcontains the worker pool, such as
us-docker.pkg.dev/cloudrun/container/worker-pool:latest - SIZE: a memory size from theCPU and memory table.The format for size is a fixed or floating point number followedby a unit:
GorMcorresponding to gigabyte or megabyte,respectively, or use the power-of-two equivalents:GiorMicorresponding to gibibyte or mebibyte respectively.
View memory configuration for the worker pool
In the Google Cloud console, go to Cloud Run:
ClickWorker pools to display the list of deployed worker pools.
Click the worker pool you want to examine to display its details pane.
Click theContainers tab to display worker pool memory configuration foreach container.
gcloud beta run worker-pools describe to view configuration details.Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.