> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/2.9/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/fpp/2.9/configuration/resource-configuration.md).

# Configuration

After deploying Fast Path Provider (FPP), you can further configure the resource usage.

## Memory configuration

It is advised to have the following resources allocated for VPPSwitch pods for the most common cases:

```yaml
resources:
  cpu: "10"
  hugepages-2Mi: 9Gi
  memory: 2Gi
```

The FPP 1.0 version is recommended to have the following settings:

```yaml
resources:
  cpu: "10"
  hugepages-2Mi: 6Gi
  memory: 6Gi
```

## CPU pinning

By default, FPP relies on [Kubernetes CPU Manager](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/) running in the `static` mode. In this mode, FPP Manager pods use Guaranteed QoS where requests are the same as the limits. As a result, the cpuset cgroup configuration is used to assign cores to the VPP process through `startup.conf`. You can check the cores assigned to the VPP processes in VPP switch pods using the following command:

```bash
cat /var/run/vppswitch/startup.conf
...
cpu {
  main-core 27
  corelist-workers 28,29,30,31
}
...
```

### Static CPU cores

It is possible to preallocate dedicated cores to VPP processes, excluding them from being used by any other process on the node. To do so:

1. Specify a subset of cores in the `isolcpus` kernel parameter (for example in `/etc/default/grub`):

   ```sh
   export GRUB_CMDLINE_LINUX='(...) isolcpus=27,28,29,30,31,59,60,61,62,63 (...)'
   ```

2. After adjusting the grub settings, run `grub-mkconfig -o /boot/grub/grub.cfg` and reboot the host. To check if the setting is configured on node, run:

   ```bash
   cat /proc/cmdline
   BOOT_IMAGE=/boot/vmlinuz-5.15.0-48-generic root=UUID=689e2902-f6d3-494b-a81f-aa1e0df5d0d6 ro isolcpus=27,28,29,30,31,59,60,61,62,63 iommu=pt intel_iommu=on pci=realloc pci=assign-busses
   ```

3. The cores must be specified together with their HyperThreading (HT) siblings in case HyperThreading is enabled on the system. To check the HT siblings, run:

   ```bash
   lstopo-no-graphics --no-io --no-legend --of txt
   ```

   (`hwloc` package) or by looking at `/sys/devices/system/cpu/cpu*/topology/thread_siblings_list` for each of the CPU cores to be used.

4. After configuration done on node level, the cores can be specified through `vpp.staticCPUCores` in `values.yaml`, but note that from each HT sibling pair, just one core can be specified:

   ```yaml
   vpp:
      staticCPUCores: 27,28,29,30,31
   ```

It's possible to verify whether the desired cores are actually assigned to the VPP process by checking `startup.conf` inside FPP pod and also e.g. by adding `PROCESSOR` column in `htop` on node.

### Max CPU cores

Another approach to VPP CPU allocation is to use `vpp.maxCPUCores` without `isolcpus` kernel parameter. In this case, like in normal FPP deployment, Guaranteed QoS class is used for FPP pods so that Kubernetes CPU Manager provides it with a dedicated cpuset. In this case FPP pod needs to be assigned more CPU than used for VPP itself, for example 14:

```yaml
resources:
  cpu: "14"
  hugepages-2Mi: 9Gi
  memory: 2Gi
vpp:
  maxCPUCores: "5"
```

In this case, FPP pod will have 7 physical cores assigned, but only 5 of them will be used for VPP.

```bash
cat /sys/fs/cgroup/cpuset/cpuset.cpus                                            │
1-7,49-55
```

Resulting `startup.conf`:

```sh
cpu {
  main-core 1
  corelist-workers 2,3,4,5
}
```

Cores 6 and 7 will be used by the Linux scheduler to run other processes than VPP, most importantly, kernel threads that are created to serve TAP interfaces (`vhost-<PID>`).
