Configurar límites de CPU para grupos de trabajadores
Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
En esta página se describe cómo especificar el número de CPUs que se van a usar en cada instancia de Cloud Run. De forma predeterminada, las instancias de contenedor de Cloud Run están limitadas a 1 CPU. Puede aumentar o reducir este valor tal como se describe en esta página.
Definir y actualizar límites de CPU
De forma predeterminada, cada instancia está limitada a 1 CPU.
Puede cambiarlo por cualquiera de los valores que se muestran en la siguiente tabla.
Tabla de CPU y memoria
Estos son los requisitos mínimos de memoria para las CPUs:
CPUs
Memoria mínima
1
128 MiB
2
128 MiB
4
2 GiB
6
4 GiB
8
4 GiB
Roles obligatorios
Para obtener los permisos que necesitas para configurar e implementar grupos de trabajadores de Cloud Run, pide a tu administrador que te conceda los siguientes roles de gestión de identidades y accesos:
Cualquier cambio en la configuración conlleva la creación de una nueva revisión. Las revisiones posteriores también recibirán automáticamente este ajuste de configuración, a menos que hagas cambios explícitos para modificarlo.
Puedes definir límites de CPU para un grupo de trabajadores de Cloud Run mediante laGoogle Cloud consola, la CLI de Google Cloud o Terraform:
Selecciona Grupos de trabajadores en el menú y haz clic en Implementar contenedor para configurar un nuevo grupo de trabajadores.
Si vas a configurar un grupo de trabajadores que ya existe, haz clic en él y, a continuación, en Editar y desplegar nueva revisión.
Si vas a configurar un grupo de trabajadores, rellena la página inicial del grupo de trabajadores y, a continuación, haz clic en Contenedores, volúmenes, redes y seguridad para desplegar la página de configuración del grupo de trabajadores.
Haz clic en la pestaña Contenedor.
Selecciona el límite de CPU en la lista desplegable CPU.
WORKER_POOL con el nombre del grupo de trabajadores.
REGION con la región Google Cloud . Por ejemplo, europe-west1.
IMAGE_URL: una referencia a la imagen del contenedor que contiene el grupo de trabajadores, como us-docker.pkg.dev/cloudrun/container/worker-pool:latest
CPU con el valor 1, 2, 4, 6 o 8
CPUs,
siguiendo los requisitos que se muestran en la tabla CPU y memoria.
Ver la configuración de CPU del grupo de trabajadores
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-21 (UTC)."],[],[],null,["# Configure CPU 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\nThis page describes how to specify the number of CPUs to use for each\nCloud Run instance. By default, Cloud Run container instances\nare limited to 1 CPU. You can increase or decrease this\nvalue as described in this page.\n\n\u003cbr /\u003e\n\nSet and update CPU limits\n-------------------------\n\nBy default, each instance is limited to 1 CPU.\nYou can change this to any of the values shown in the following table.\n\n### CPU and memory table\n\nThe following are minimum memory requirements for CPUs:\n\n\u003cbr /\u003e\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 CPU 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 CPU 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 CPU limit from the **CPU** dropdown list.\n5. Click **Create** or **Deploy**.\n\n### gcloud\n\nYou can [update the CPU limits](/sdk/gcloud/reference/beta/run/worker-pools/update)\nfor a given worker pool by using the following command: \n\n```bash\ngcloud beta run worker-pools update WORKER_POOL --cpu CPU\n```\n\nReplace\n\n- \u003cvar translate=\"no\"\u003eWORKER_POOL\u003c/var\u003e with the name of your worker pool\n- \u003cvar translate=\"no\"\u003eCPU\u003c/var\u003e with the CPU limit. Specify the value `1`, `2`, `4`, `6`, or `8` CPUs, following the requirements shown in the [CPU and memory](#cpu-memory) table.\n\nYou can also set CPU 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 --cpu CPU\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\"\u003eCPU\u003c/var\u003e with the value `1`, `2`, `4`, `6`, or `8` CPUs, following the requirements shown in the [CPU and memory](#cpu-memory) table.\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 cpu = \"\u003cvar translate=\"no\"\u003eCPU\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\"\u003eCPU\u003c/var\u003e with the value `1`, `2`, `4`, `6`, or `8` CPUs, following the requirements shown in the [CPU and memory](#cpu-memory) table.\n\nView CPU 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 CPU configuration for the worker pool.\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."]]