Configure CPU limits for worker pools

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.

This page describes how to specify the number of vCPUs to use for eachCloud Run instance. By default, Cloud Run container instancesare limited to 1 vCPU. You can increase or decrease thisvalue as described in this page.

Set and update vCPU limits

By default, each instance is limited to 1 vCPU.You can change this to any of the values shown in the following table.

vCPU and memory table

The following are memory requirements for vCPUs:

CPUsMemory required
1 vCPU128 MiB to 4 GiB
2 vCPU128 MiB to 8 GiB
4 vCPU2 to 16 GiB
6 vCPU4 to 24 GiB
8 vCPU4 to 32 GiB

Maximum amount of vCPU

The maximum amount of vCPU you can configure is 8 vCPU.

Minimum amount of vCPU

The minimum vCPU setting is 0.08 vCPU.

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:

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 CPU 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 CPU limits for a Cloud Run worker pool using theGoogle Cloud console, the Google Cloud CLI, YAML, or Terraform:

Console

  1. In the Google Cloud console, go to Cloud Run:

    Go to Cloud Run

  2. 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.

  3. 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.

  4. Click theContainer tab.

    image

    • Select the CPU limit from theCPU dropdown list.
  5. ClickCreate orDeploy.

gcloud

You canupdate the CPU limitsfor a given worker pool by using the following command:

gcloudbetarunworker-poolsupdateWORKER_POOL--cpuCPU

Replace

  • WORKER_POOL with the name of your worker pool
  • CPU with the CPU limit. Specify the value1,2,4,6, or8CPUs,following the requirements shown in theCPU and memory table.

You can also set CPU duringdeployment using the command:

gcloudbetarunworker-poolsdeploy--imageIMAGE_URL--cpuCPU

Replace

  • IMAGE_URL: a reference to the container image thatcontains the worker pool, such asus-docker.pkg.dev/cloudrun/container/worker-pool:latest.
  • CPU with the value1,2,4,6, or8CPUs,following the requirements shown in theCPU and memory table.

YAML

  1. 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.yaml
  2. The 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:cpu:`CPU`

    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 asus-docker.pkg.dev/cloudrun/container/worker-pool:latest.
    • CPU: the CPU limit value.Specify the value1,2,4,6, or8CPUs, or for less than 1 CPU,specify a value from 0.08 to less than 1.00, in increments of 0.01. (See the table underSetting and updating CPU limits for required settings.)
  3. 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={cpu="CPU"}}}}}

Replace:

  • WORKER_POOL with the name of the worker pool.
  • REGION with the Google Cloud region. For example,europe-west1.
  • IMAGE_URL: a reference to the container image thatcontains the worker pool, such asus-docker.pkg.dev/cloudrun/container/worker-pool:latest
  • CPU with the value1,2,4,6, or8CPUs,following the requirements shown in theCPU and memory table.

View CPU configuration for the worker pool

  1. In the Google Cloud console, go to Cloud Run:

    Go to Cloud Run

  2. ClickWorker pools to display the list of deployed worker pools.

  3. Click the worker pool you want to examine to display its details pane.

  4. Click theContainers tab to display CPU configuration for the worker pool.

Note: You can also use the Google Cloud CLI commandgcloud 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.