> ## Documentation Index
> Fetch the complete documentation index at: https://inframan.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Right-sizing

> Match what your services reserve to what they use, so you don't pay for nodes that sit idle.

Kubernetes places pods by what they **request**, not by what they use. A service that requests 1 CPU and uses 100m keeps 900m of a node reserved for nothing, and enough of those adds whole nodes to your bill.

## Find over-sized services

1. Open **Observability** and select **Platform**. CPU and memory are shown as **requested**, **used** and **allocatable**. A large gap between requested and used means reserved capacity nobody uses.
2. Select **Applications**, then **Metrics**, and look at each service's **CPU Usage** and **Memory Usage** over a typical week.
3. Compare with the service's requests.

## Set requests and limits

Set them per service in [`inframan.yaml`](https://inframan.mintlify.site/deploy/inframan-yaml#resources):

```yaml inframan.yaml theme={null}
services:
  api:
    port: 8080
    resources:
      cpu_request: 100m
      memory_request: 192Mi
      cpu_limit: 500m
      memory_limit: 384Mi
```

* **Requests** are what the service reserves. Set them near its typical use.
* **Limits** cap it. A replica that exceeds its memory limit is restarted, so give memory some headroom over the peak.
* On non-production infrastructures the defaults are a `100m` / `128Mi` request and a `500m` / `256Mi` limit.

Different sizes for production and non-production go under [`environments`](https://inframan.mintlify.site/deploy/inframan-yaml#environment-overrides).

> [!TIP]
>
> With `hpa` scaling, the CPU target is a percentage of the request. Lowering a request makes the autoscaler add replicas sooner, so adjust `cpu` with it.

## Who changes what

Inframan never resizes your services on its own. A change to your service's resources is always one you made in `inframan.yaml`, reviewed like any other change.

The platform's own components are different. Inframan starts the ingress, Knative and the monitoring stack small, and raises their memory or CPU automatically when they run short, step by step up to a ceiling. See [Self-healing](https://inframan.mintlify.site/monitor/self-healing.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.