Stay organized with collectionsSave and categorize content based on your preferences.
You can choose the amount of memory to provide for your Cloud Run
worker pool. This page describes how to specify the amount of memory
available for your worker pool.
Understand memory usage
Cloud Run instances that exceed their allowed memory limit are
terminated.
The available memory for your instance needs to be sufficient for:
Running the worker pool executable, because the executable must be loaded to
memory
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 available
for 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 is
512 MiB.
Required minimum CPUs
The amount of allocated memory you choose corresponds to an amount of minimum
CPU for your worker pool. When setting a memory limit, the following
minimum CPU limits are required:
Memory
Minimum CPUs required
2 GiB
1 vCPU
More than 4 GiB
2 vCPU
More than 8 GiB
4 vCPU
More than 16 GiB
6 vCPU
More than 24 GiB
8 vCPU
Maximum amount of memory
The maximum amount of memory you can configure is
32 gibibyte (32 Gi).
Any configuration change leads to the
creation of a new revision. Subsequent revisions will also automatically get
this configuration setting unless you make explicit updates to change it.
You can set memory limits for a Cloud Run worker pool using the
Google Cloud console, the Google Cloud CLI, or Terraform:
SelectWorker poolsfrom the menu, and clickDeploy containerto
configure a new worker pool.
If you are configuring an existing worker pool, click the
worker pool, then clickEdit and deploy new revision.
If you are configuring a new worker pool, fill out the initial worker
pool page, then clickContainer(s), Volumes, Networking, Securityto expand the
worker pools configuration page.
Click theContainertab.
Select the desired memory size from theMemorydropdown list.
SIZEwith a memory size from theCPU and memory table.
The format for size 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.
You can also set memory limits duringdeploymentusing the command:
IMAGE_URL: a reference to the container image that
contains the worker pool, such asus-docker.pkg.dev/cloudrun/container/worker-pool:latest.
SIZEwith 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 the
power-of-two equivalents: Gi or Mi corresponding to gibibyte or mebibyte
respectively.
REGIONwith the Google Cloud region. For example,
europe-west1.
IMAGE_URL: a reference to the container image that
contains the worker pool, such asus-docker.pkg.dev/cloudrun/container/worker-pool:latest
SIZEwith a memory size from theCPU and memory table.
The format for size 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Configure memory limits for worker pools\n\n| **Preview\n| --- Cloud Run worker pools**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can choose the amount of memory to provide for your Cloud Run\nworker pool. This page describes how to specify the amount of memory\navailable for your worker pool.\n\nUnderstand memory usage\n-----------------------\n\nCloud Run instances that exceed their allowed memory limit are\nterminated.\n\nThe available memory for your instance needs to be sufficient for:\n\n- Running the worker pool executable, because the executable must be loaded to memory\n- Allocating memory in your worker pool process\n- Writing files to the file system\n\nThe size of the deployed container image does not affect memory that is available\nfor the instance.\n\nSet and update memory limits\n----------------------------\n\nYou can set memory limits on Cloud Run worker pools.\nBy default, the memory allocated to each worker pool is\n512 MiB.\n\n### Required minimum CPUs\n\nThe amount of allocated memory you choose corresponds to an amount of minimum\nCPU for your worker pool. When setting a memory limit, the following\nminimum CPU limits are required:\n\n### Maximum amount of memory\n\nThe maximum amount of memory you can configure is\n32 gibibyte (`32 Gi`).\nYou can enforce a maximum memory limit by using [custom organization policies](/run/docs/securing/custom-constraints#memory-limit).\n\n### Minimum memory\n\nThe minimum memory setting is 512 MiB.\n\nRequired roles\n--------------\n\n\nTo get the permissions that\nyou need to configure and deploy Cloud Run worker pools,\n\nask your administrator to grant you the\nfollowing IAM roles:\n\n- [Cloud Run Developer](/iam/docs/roles-permissions/run#run.developer) (`roles/run.developer`) on the Cloud Run worker pool\n- [Service Account User](/iam/docs/roles-permissions/iam#iam.serviceAccountUser) (`roles/iam.serviceAccountUser`) on the service identity\n\n\nFor a list of IAM roles and permissions that are associated with\nCloud Run, see\n[Cloud Run IAM roles](/run/docs/reference/iam/roles)\nand [Cloud Run IAM permissions](/run/docs/reference/iam/permissions).\nIf your Cloud Run worker pool interfaces with\nGoogle Cloud APIs, such as Cloud Client Libraries, see the\n[service identity configuration guide](/run/docs/configuring/workerpools/service-identity).\nFor more information about granting roles, see\n[deployment permissions](/run/docs/reference/iam/roles#additional-configuration)\nand [manage access](/iam/docs/granting-changing-revoking-access).\n\nConfigure memory limits\n-----------------------\n\nAny configuration change leads to the\ncreation of a new revision. Subsequent revisions will also automatically get\nthis configuration setting unless you make explicit updates to change it.\n\nYou can set memory limits for a Cloud Run worker pool using the\nGoogle Cloud console, the Google Cloud CLI, or Terraform: \n\n### Console\n\n\n1. In the Google Cloud console, go to Cloud Run:\n\n [Go to Cloud Run](https://console.cloud.google.com/run/worker-pools)\n2. Select **Worker pools** from the menu, and click **Deploy container** to\n configure a new worker pool.\n If you are configuring an existing worker pool, click the\n worker pool, then click **Edit and deploy new revision**.\n\n3. If you are configuring a new worker pool, fill out the initial worker\n pool page, then click **Container(s), Volumes, Networking, Security** to expand the\n worker pools configuration page.\n\n4. Click the **Container** tab.\n\n - Select the desired memory size from the **Memory** dropdown list.\n5. Click **Create** or **Deploy**.\n\n### gcloud\n\nYou can [update the memory allocation](/sdk/gcloud/reference/beta/run/worker-pools/update)\nof a given worker pool by using the following command: \n\n```bash\ngcloud beta run worker-pools update WORKER_POOL --memory SIZE\n```\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003eWORKER_POOL\u003c/var\u003e with the name of your worker pool\n- \u003cvar translate=\"no\"\u003eSIZE\u003c/var\u003e with a memory size from the [CPU and memory table](#cpu-minimum). 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 the power-of-two equivalents: `Gi` or `Mi` corresponding to gibibyte or mebibyte respectively.\n\nYou can also set memory limits during\n[deployment](/sdk/gcloud/reference/beta/run/worker-pools/deploy) using the command: \n\n```bash\ngcloud beta run worker-pools deploy --image IMAGE_URL --memory SIZE\n```\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003eIMAGE_URL\u003c/var\u003e: a reference to the container image that contains the worker pool, such as `us-docker.pkg.dev/cloudrun/container/worker-pool:latest`.\n- \u003cvar translate=\"no\"\u003eSIZE\u003c/var\u003e with a memory size from the [CPU and memory table](#cpu-minimum). 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 the power-of-two equivalents: Gi or Mi corresponding to gibibyte or mebibyte respectively.\n\n### Terraform\n\n\u003cbr /\u003e\n\nTo learn how to apply or remove a Terraform configuration, see\n[Basic Terraform commands](/docs/terraform/basic-commands).\n\n\u003cbr /\u003e\n\n resource \"google_cloud_run_v2_worker_pool\" \"default\" {\n name = \"\u003cvar translate=\"no\"\u003eWORKER_POOL\u003c/var\u003e\"\n location = \"\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e\"\n launch_stage = \"BETA\"\n\n template {\n containers {\n image = \"\u003cvar translate=\"no\"\u003eIMAGE_URL\u003c/var\u003e\"\n resources {\n limits = {\n memory = \"\u003cvar translate=\"no\"\u003eSIZE\u003c/var\u003e\"\n }\n }\n }\n }\n }\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003eWORKER_POOL\u003c/var\u003e with the name of the worker pool.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e with the Google Cloud region. For example, europe-west1.\n- \u003cvar translate=\"no\"\u003eIMAGE_URL\u003c/var\u003e: a reference to the container image that contains the worker pool, such as `us-docker.pkg.dev/cloudrun/container/worker-pool:latest`\n- \u003cvar translate=\"no\"\u003eSIZE\u003c/var\u003e with a memory size from the [CPU and memory table](#cpu-minimum). 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 the power-of-two equivalents: `Gi` or `Mi` corresponding to gibibyte or mebibyte respectively.\n\nView memory configuration for the worker pool\n---------------------------------------------\n\n1. In the Google Cloud console, go to Cloud Run:\n\n [Go to Cloud Run](https://console.cloud.google.com/run/worker-pools)\n2. Click **Worker pools** to display the list of deployed worker pools.\n\n3. Click the worker pool you want to examine to display its details pane.\n\n4. Click the **Containers** tab to display worker pool memory configuration for\n each container.\n\n| **Note:** You can also use the Google Cloud CLI command [`gcloud beta run worker-pools describe`](/sdk/gcloud/reference/beta/run/worker-pools/describe) to view configuration details."]]