Determines whether CPU is only allocated during requests (true by default). However, if ResourceRequirements is set, the caller must explicitly set this field to true to preserve the default behavior.
↳ startup_cpu_boost
bool
Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
Determines whether CPU is only allocated during requests (true by default).
However, if ResourceRequirements is set, the caller must explicitly
set this field to true to preserve the default behavior.
Returns
Type
Description
bool
setCpuIdle
Determines whether CPU is only allocated during requests (true by default).
However, if ResourceRequirements is set, the caller must explicitly
set this field to true to preserve the default behavior.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getStartupCpuBoost
Determines whether CPU should be boosted on startup of a new container
instance above the requested CPU threshold, this can help reduce cold-start
latency.
Returns
Type
Description
bool
setStartupCpuBoost
Determines whether CPU should be boosted on startup of a new container
instance above the requested CPU threshold, this can help reduce cold-start
latency.
[[["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,["# Google Cloud Run V2 Client - Class ResourceRequirements (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/php/docs/reference/cloud-run/latest/V2.ResourceRequirements)\n- [1.8.0](/php/docs/reference/cloud-run/1.8.0/V2.ResourceRequirements)\n- [1.7.0](/php/docs/reference/cloud-run/1.7.0/V2.ResourceRequirements)\n- [1.6.0](/php/docs/reference/cloud-run/1.6.0/V2.ResourceRequirements)\n- [1.5.2](/php/docs/reference/cloud-run/1.5.2/V2.ResourceRequirements)\n- [1.4.0](/php/docs/reference/cloud-run/1.4.0/V2.ResourceRequirements)\n- [1.3.0](/php/docs/reference/cloud-run/1.3.0/V2.ResourceRequirements)\n- [1.2.0](/php/docs/reference/cloud-run/1.2.0/V2.ResourceRequirements)\n- [1.1.0](/php/docs/reference/cloud-run/1.1.0/V2.ResourceRequirements)\n- [1.0.0](/php/docs/reference/cloud-run/1.0.0/V2.ResourceRequirements)\n- [0.9.3](/php/docs/reference/cloud-run/0.9.3/V2.ResourceRequirements)\n- [0.8.0](/php/docs/reference/cloud-run/0.8.0/V2.ResourceRequirements)\n- [0.7.2](/php/docs/reference/cloud-run/0.7.2/V2.ResourceRequirements)\n- [0.6.0](/php/docs/reference/cloud-run/0.6.0/V2.ResourceRequirements)\n- [0.5.2](/php/docs/reference/cloud-run/0.5.2/V2.ResourceRequirements)\n- [0.4.0](/php/docs/reference/cloud-run/0.4.0/V2.ResourceRequirements)\n- [0.3.4](/php/docs/reference/cloud-run/0.3.4/V2.ResourceRequirements) \nReference documentation and code samples for the Google Cloud Run V2 Client class ResourceRequirements.\n\nResourceRequirements describes the compute resource requirements.\n\nGenerated from protobuf message `google.cloud.run.v2.ResourceRequirements`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Run \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getLimits\n\nOnly `memory` and `cpu` keys in the map are supported.\n\n\u003cbr /\u003e\n\nNotes:\n\n- The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to \u003chttps://cloud.google.com/run/docs/configuring/cpu\u003e.\n - For supported 'memory' values and syntax, go to \u003chttps://cloud.google.com/run/docs/configuring/memory-limits\u003e\n\n### setLimits\n\nOnly `memory` and `cpu` keys in the map are supported.\n\n\u003cbr /\u003e\n\nNotes:\n\n- The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to \u003chttps://cloud.google.com/run/docs/configuring/cpu\u003e.\n - For supported 'memory' values and syntax, go to \u003chttps://cloud.google.com/run/docs/configuring/memory-limits\u003e\n\n### getCpuIdle\n\nDetermines whether CPU is only allocated during requests (true by default).\n\nHowever, if ResourceRequirements is set, the caller must explicitly\nset this field to true to preserve the default behavior.\n\n### setCpuIdle\n\nDetermines whether CPU is only allocated during requests (true by default).\n\nHowever, if ResourceRequirements is set, the caller must explicitly\nset this field to true to preserve the default behavior.\n\n### getStartupCpuBoost\n\nDetermines whether CPU should be boosted on startup of a new container\ninstance above the requested CPU threshold, this can help reduce cold-start\nlatency.\n\n### setStartupCpuBoost\n\nDetermines whether CPU should be boosted on startup of a new container\ninstance above the requested CPU threshold, this can help reduce cold-start\nlatency."]]