Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Does the cpu flag in gcloud run deploy control the number of cpus per VM or the total amount of cpu

Looking at documentation:

--cpu=CPUSet a CPU limit in Kubernetes cpu units.

Cloud Run (fully managed) supports values 1, 2 and 4. For Cloud Run (fully managed), 4 cpus also requires a minimum 2Gi --memory value. Examples 2, 2.0, 2000m

Cloud Run for Anthos and Knative-compatible Kubernetes clusters support fractional values. Examples .5, 500m, 2

Kubernetes page says:

Limits and requests for CPU resources are measured in cpu units. In Kubernetes, 1 CPU unit is equivalent to 1 physical CPU core, or 1 virtual core, depending on whether the node is a physical host or a virtual machine running inside a physical machine.

So does this setting control the CPU per VM or is it the total amount of CPU? Same question applies to the --memory flag.

 

 

 

Solved Solved
0 2 2,008
1 ACCEPTED SOLUTION

According to this documentation:

You can set CPU limits for Cloud Run services and jobs.

By default, each container instance is limited to 1 CPU. You can increase this using any integer value up to a maximum of 8 CPUs. Note that setting CPU greater than 4 is a preview feature.

CPU and memory

The following are minimum memory requirements for CPUs:

 

CPUs

Minimum memory

4

2 GiB

6 PREVIEW

3 GiB

8 PREVIEW

4 GiB

This setting will control the CPU per instance created

  • CPU with the desired CPU limit. Specify the value 1, 2, 4, 6, or 8 CPUs, 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 under Setting and updating CPU limits for required settings.)

View solution in original post

2 REPLIES 2

According to this documentation:

You can set CPU limits for Cloud Run services and jobs.

By default, each container instance is limited to 1 CPU. You can increase this using any integer value up to a maximum of 8 CPUs. Note that setting CPU greater than 4 is a preview feature.

CPU and memory

The following are minimum memory requirements for CPUs:

 

CPUs

Minimum memory

4

2 GiB

6 PREVIEW

3 GiB

8 PREVIEW

4 GiB

This setting will control the CPU per instance created

  • CPU with the desired CPU limit. Specify the value 1, 2, 4, 6, or 8 CPUs, 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 under Setting and updating CPU limits for required settings.)

What does it mean "preview feature"? Should I enable it somewhere before I can use it?
Currently I can't set CPU higher than 4

Top Solution Authors