# Class ResourceRequirements (0.16.1)

0.16.1 (latest) 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.19 0.9.1 0.8.1 0.7.1 0.6.0 0.5.0 0.4.2 0.3.0 0.2.1 0.1.0

    ResourceRequirements(mapping=None, *, ignore_unknown_fields=False, **kwargs)

ResourceRequirements describes the compute resource
requirements.

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `limits` | `MutableMapping[str, str]` Only `memory`, `cpu` and `nvidia.com/gpu` keys in the map are supported. .. raw:: html Notes: \* 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 https://cloud.google.com/run/docs/configuring/cpu. \* For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits \* The only supported 'nvidia.com/gpu' value is '1'. |
| `cpu_idle` | `bool` 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. |

## Classes

### LimitsEntry

    LimitsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |