CPUs kept for the forge's own process (#13642)
On a busy machine, cells and checks running on every core can stall the forge's own serving thread, so pages wait. The capacity setting cells.servingCores (Settings → Capacity, "CPUs kept for the forge itself"; env FORGE_SERVING_CORES) keeps that many CPUs for the forge alone.
- What it does: the forge keeps the first N cores of the ones its process may run on (in a pod held to a cpuset, those are the cpuset's own numbers, not 0 to N-1). Every cell is started under
taskset -con the other cores: apps, terminals, hosted child forges and check steps. A check's shards are forked inside its step's cell, so they keep off those cores too. A cell with a CPU quota of its own still rotates over its cores, but only among the cores left over. - Default, by the CPUs the forge has: none below 8 CPUs, so a small forge runs as it always has. From 8 CPUs up it keeps one per 16, at least 1 and at most 4: 8–31 CPUs keep 1, 32–47 keep 2, 48–63 keep 3, 64 or more keep 4.
- The cap: cells always keep at least half the cores. A setting above half of them is held to half.
- No
taskset: where util-linux'stasksetis missing, nothing is pinned and cells run on every core as before. The forge's log says so once: "cpu: taskset is absent, so the N cores kept for this forge are not held; cells run on every core". - When it applies: the setting is read every time a cell opens, so a change reaches the next cell started. Cells already running keep the cores they had.
Set it like any capacity row, with a reason. Put back returns it to the default.