|
| 1 | +--- |
| 2 | +title: "Host Resource Reservations" |
| 3 | +description: "Reserving CPU and Memory to ensure GMT has sufficient compute power to orchestrate measurement" |
| 4 | +date: 2025-12-15T16:20:15+10:00 |
| 5 | +weight: 1005 |
| 6 | +toc: false |
| 7 | +--- |
| 8 | + |
| 9 | +GMT runs on the host system orchestrating containers. To have this process running smoothly. |
| 10 | +GMT reserves a share of the available CPUs and the available Memory for the host system. |
| 11 | + |
| 12 | +This ensures: |
| 13 | + |
| 14 | +- Host does not OOM and measurement fails |
| 15 | +- Host does not run into CPU scarcity and metric providers can safely capture all metrics |
| 16 | + |
| 17 | +The setting is configured *per machine* in the `config.yml` |
| 18 | + |
| 19 | +```yml |
| 20 | +# config.yml |
| 21 | +machine: |
| 22 | + ... |
| 23 | + host_reserved_cpus: 1 |
| 24 | + host_reserved_memory: 1073741824 # 1 GiB |
| 25 | + |
| 26 | +``` |
| 27 | + |
| 28 | +#### Specifications |
| 29 | + |
| 30 | +- `host_reserved_cpus` **[integer]** (Default 1): Value between 1 and CPU_MAX. CPU_MAX is the amount of available compute threads on the system. |
| 31 | +- `host_reserved_memory` **[integer]** (Default 0): Value between 0 and MEMORY_MAX. MEMORY_MAX is the amount of available physical memory on the system. |
| 32 | + |
| 33 | +## How to choose good values |
| 34 | + |
| 35 | +### CPU |
| 36 | + |
| 37 | +GMT will always reserve one core. So setting a value for `host_reserved_cpus` < 1 will fail. Typically GMT does not need more than one core, so you only should set this value to a higher value if your system has SMT / Hyper-Threading enabled or your host does a lot of other operations that should run undisturbed by the orchestrated containers. |
| 38 | + |
| 39 | +For the former you should reserve as much cores as the SMT increases the core count. Typically SMT doubles a physical core to two hyper-cores. Thus you should set the reservation to two cores. |
| 40 | + |
| 41 | +For the latter however though this indicates that the machine is a *noisy* measurement machine and we currently do not see any valid case for such a measurement machine ... write us an email if you have a one :) |
| 42 | + |
| 43 | +### Memory |
| 44 | + |
| 45 | +The default value for memory reservations in development is 0. This means Memory can be overcommited. In development this is fine as OOM situations can be resolved manually and it makes development quicker as containers have more memory to work with. |
| 46 | + |
| 47 | +In a cluster setup the value should be derived as follows: |
| 48 | + |
| 49 | +- Start the GMT `client.py` |
| 50 | +- Wait 30 seconds until the python process has reserved all memory it needs |
| 51 | +- Check `free -m` and read the current *used* memory. |
| 52 | +- Add 300 MB and round up to the neareast half GiB (e.g 2.1 GiB (+300 MB) used memory rounds up 2.5 GiB) |
0 commit comments