> For the complete documentation index, see [llms.txt](https://docs.cybus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cybus.io/2-4-1/cybus-helm-charts/working-with-cybus-helm-charts/compute-resources.md).

# Configuring Compute Resources

Kubernetes uses compute resource [requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) to schedule workloads onto nodes with sufficient capacity, and limits to cap how much a workload can consume. Configure requests and limits for both the components deployed with the `connectware` Helm chart and the agents deployed with the `connectware-agent` Helm chart.

By default, Connectware is configured with requests only and no limits, which allows it to burst and use available node resources when needed. Required resources depend heavily on the protocols, services, message rates, and payload sizes in your deployment. Monitor actual resource usage and adjust these values accordingly. For guidance on measuring usage and identifying bottlenecks, see [Right-Sizing Kubernetes Resources for Connectware](/2-4-1/guides/right-sizing-kubernetes-resources.md).

## Configuration Values

The following Helm value controls compute resources. Set it per component in the `connectware` Helm chart, or per agent in the `connectware-agent` Helm chart, to override the chart's defaults.

| Helm chart          | Value                                                   | Description                                                                                                           |
| ------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `connectware`       | `<component>.resources.requests.cpu`                    | CPU the scheduler reserves for the pod's containers.                                                                  |
| `connectware`       | `<component>.resources.requests.memory`                 | Memory the scheduler reserves for the pod's containers.                                                               |
| `connectware`       | `<component>.resources.limits.cpu`                      | CPU ceiling for the pod's containers. When reached, the kernel throttles the container.                               |
| `connectware`       | `<component>.resources.limits.memory`                   | Memory ceiling for the pod's containers. When exceeded, the container is OOMKilled and restarted.                     |
| `connectware-agent` | `protocolMapperAgentDefaults.resources.requests.cpu`    | CPU the scheduler reserves for the pod's containers, for all agents.                                                  |
| `connectware-agent` | `protocolMapperAgentDefaults.resources.requests.memory` | Memory the scheduler reserves for the pod's containers, for all agents.                                               |
| `connectware-agent` | `protocolMapperAgentDefaults.resources.limits.cpu`      | CPU ceiling for the pod's containers, for all agents. When reached, the kernel throttles the container.               |
| `connectware-agent` | `protocolMapperAgentDefaults.resources.limits.memory`   | Memory ceiling for the pod's containers, for all agents. When exceeded, the container is OOMKilled and restarted.     |
| `connectware-agent` | `protocolMapperAgents[].resources.requests.cpu`         | CPU the scheduler reserves for the pod's containers, for a single agent.                                              |
| `connectware-agent` | `protocolMapperAgents[].resources.requests.memory`      | Memory the scheduler reserves for the pod's containers, for a single agent.                                           |
| `connectware-agent` | `protocolMapperAgents[].resources.limits.cpu`           | CPU ceiling for the pod's containers, for a single agent. When reached, the kernel throttles the container.           |
| `connectware-agent` | `protocolMapperAgents[].resources.limits.memory`        | Memory ceiling for the pod's containers, for a single agent. When exceeded, the container is OOMKilled and restarted. |

{% hint style="info" %}
`cpu` and `memory` accept any Kubernetes [Quantity](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/).
{% endhint %}

The two charts configure resources differently. Select the tab for the chart you use.

{% tabs %}
{% tab title="connectware Helm Chart" %}
You configure each Connectware component separately. There is no global key to apply resources to all components at once.

### Default Values

Every component comes with default CPU and memory requests and no limits. To see the default request values for every component, extract the chart's default values:

{% code lineNumbers="true" %}

```bash
helm show values oci://repo.cybus.io/charts/connectware > default-values.yaml
```

{% endcode %}

The `resources` entry under each component in the resulting `default-values.yaml` file shows its default requests.

### Configuring Resources for a Component

To configure a component, set its `resources`, for example `broker.resources`, with requests and limits as Kubernetes quantities. Components you do not list keep their default requests.

{% code title="values.yaml" lineNumbers="true" %}

```yaml
broker:
  resources:
    requests:
      cpu: 1500m
      memory: 1500Mi
    limits:
      cpu: 2000m
      memory: 3000Mi
```

{% endcode %}

To configure several components, list each one. To run a component without limits, set only its `requests`.

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapper:
  resources:
    requests:
      cpu: 1500m
      memory: 1500Mi
    limits:
      cpu: 2000m
      memory: 3000Mi
authServer:
  resources:
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      cpu: 1000m
      memory: 1000Mi
```

{% endcode %}
{% endtab %}

{% tab title="connectware-agent Helm Chart" %}
Set resources for all agents at once with `protocolMapperAgentDefaults`, then override individual agents in `protocolMapperAgents`.

### Default Values

Agents installed through the `connectware-agent` Helm chart come with the following default requests. No limits are set by default.

| Resource | Requests | Limits |
| -------- | -------- | ------ |
| CPU      | `1000m`  | None   |
| Memory   | `1000Mi` | None   |

### Configuring Resources for All Agents

To apply compute resources to all agents, set `resources.requests` and `resources.limits` under `protocolMapperAgentDefaults` in your `values.yaml` file. Helm merges your `values.yaml` with the chart's defaults, so you can set only `limits` and the default `requests` are preserved:

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgentDefaults:
  resources:
    limits:
      cpu: 3000m
      memory: 2500Mi
```

{% endcode %}

This configuration applies your `limits` plus the default `requests` of `1000m`/`1000Mi` to all agents. To override requests as well, specify them alongside limits:

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgentDefaults:
  resources:
    requests:
      cpu: 1000m
      memory: 1500Mi
    limits:
      cpu: 3000m
      memory: 2500Mi
```

{% endcode %}

### Configuring Resources for a Single Agent

To override resources for a specific agent, set `resources` inside that agent's entry in `protocolMapperAgents`:

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgents:
  - name: bender-robots
    resources:
      requests:
        cpu: 1000m
        memory: 1500Mi
      limits:
        cpu: 3000m
        memory: 2500Mi
```

{% endcode %}

{% hint style="warning" %}
Per-agent `resources` fully replace the `resources` from `protocolMapperAgentDefaults`. Helm does not merge values at this level. For example, if you set only `resources.limits` on an agent, the agent has limits but no requests because the default requests are not inherited.
{% endhint %}

These values apply only to the `bender-robots` agent and do not affect other agents in the same Helm release. For details on how defaults and per-agent overrides interact, see [Configuration Principles for the connectware-agent Helm Chart](/2-4-1/cybus-helm-charts/connectware-agent-helm-chart.md#configuration-principles-for-the-connectware-agent-helm-chart).

Per-agent `resources` fully replace the defaults. To give an agent requests but no limits, set only `requests`. The omitted limits are not inherited from the defaults:

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgents:
  - name: bender-robots
    resources:
      requests:
        cpu: 1000m
        memory: 1000Mi
```

{% endcode %}

### Removing Resources

To remove compute resources, set `resources` to `null`. This works the same way whether you set it on `protocolMapperAgentDefaults` to remove the defaults for all agents, or on an individual agent in `protocolMapperAgents` to remove resources for that agent only.

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgentDefaults:
  resources: null # removes default resources for all agents
protocolMapperAgents:
  - name: bender-robots
    resources: null # removes resources for this agent only
```

{% endcode %}

### Full Example

This example sets lower default resources for all agents, then overrides the `welder-robots` agent with higher requests and no limits. The requests are repeated explicitly because per-agent `resources` fully replace the defaults:

{% code title="values.yaml" lineNumbers="true" %}

```yaml
protocolMapperAgentDefaults:
  resources:
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      cpu: 1500m
      memory: 2000Mi
protocolMapperAgents:
  - name: bender-robots # inherits the default resources
  - name: welder-robots # higher requests, no limits
    resources:
      requests:
        cpu: 2000m
        memory: 2000Mi
  - name: painter-robots # inherits the default resources
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Reference

For the full list of resource-related Helm values, see the [Connectware Helm Chart Values Reference](/2-4-1/reference/helm-chart-reference.md#connectware-helm-chart-values-reference) and the [Connectware-Agent Helm Chart Values Reference](/2-4-1/reference/helm-chart-reference.md#connectware-agent-helm-chart-values-reference).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cybus.io/2-4-1/cybus-helm-charts/working-with-cybus-helm-charts/compute-resources.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
