Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Configurar limites de memória e vCPU (1ª geração)
É possível provisionar o Cloud Run functions com diferentes quantidades de memória para controlar
o limite de memória que pode ser usada por uma função. A quantidade de memória
alocada escolhida corresponde a uma quantidade de CPU alocada para sua função.
Os níveis de memória e CPU disponíveis são mostrados na tabela a seguir:
Memória
CPU
128 MB
.083 vCPU
256 MB
.167 vCPU
512 MB
.333 vCPU
1.024 MB
.583 vCPU
2.048 MB
1 vCPU
4.096 MB
2 vCPU
8.192 MB
2 vCPU
Indisponível
4 vCPUs
Indisponível
8 vCPUs
Por padrão, a memória alocada para uma função é de 256 MB ou 256 MiB, dependendo
da versão do produto do Cloud Run functions.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-01-31 UTC."],[[["\u003cp\u003eCloud Run functions can be provisioned with varying memory amounts, which directly correlates to the allocated CPU for the function.\u003c/p\u003e\n"],["\u003cp\u003eThe memory and CPU tiers available range from 128MB with .083 vCPU to 8192MB with 2 vCPU, as outlined in the provided table.\u003c/p\u003e\n"],["\u003cp\u003eBy default, a function is allocated 256MB of memory, however, this can be changed.\u003c/p\u003e\n"],["\u003cp\u003eYou can adjust the allocated memory for a function during deployment using the \u003ccode\u003e--memory\u003c/code\u003e flag in the gcloud CLI or through the "Memory allocated" field in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eMemory and CPU allocations impact the costs associated with running Cloud Run functions, detailed information regarding pricing can be found on the Cloud Run functions Pricing page.\u003c/p\u003e\n"]]],[],null,["# Configure memory and vCPU limits (1st gen)\n==========================================\n\nYou can provision Cloud Run functions with different amounts of memory to control\nthe limit on how much memory a function can use. The amount of allocated\nmemory you choose corresponds to an amount of allocated CPU for your function.\nAvailable memory and CPU tiers are shown in the following table:\n\n| **Note:** 1 vCPU is equal to 2.4GHz. CPU allocations are an approximation. Actual allocation of CPU clock cycles may vary slightly across function invocations.\n\nBy default, the memory allocated for a function is 256MB or 256 MiB depending\non the Cloud Run functions product version.\n\nSee [Cloud Run functions Pricing](/functions/pricing) for information about costs\nassociated with memory and CPU allocations.\n\nSet a memory limit\n------------------\n\nYou can set a function's allocated memory at deployment using the\nGoogle Cloud CLI or the Google Cloud console: \n\n### gcloud\n\nIf you are deploying a function using the gcloud CLI, use the\n[`--memory`](/sdk/gcloud/reference/functions/deploy#--memory) flag: \n\n```sh\ngcloud functions deploy YOUR_FUNCTION_NAME --no-gen2 --memory=MEMORY_LIMIT ...\n```\n\n### Console\n\nTo set the allocated memory during function creation in the\nGoogle Cloud console:\n\n1. Go to the [Cloud Run functions Overview page](https://console.cloud.google.com/functions/list) in the Google Cloud console.\n2. Click **Create function**.\n3. Fill in the required fields for your function.\n4. Expand the **Runtime, build...** section at the end of the page and click the **Runtime** tab.\n5. In the **Memory allocated** field, select an amount of memory.\n6. Click **Next**.\n7. Click **Deploy**."]]