Admission
A runner starts only when it fits the slice’s MemoryMax beside what already runs, and what the host’s memory leaves the slice. By default it reserves its job’s predicted peak, from the job’s sampled peaks (measured admission); a job with too little history reserves its profile’s memory. From the same peaks runnerd also gives:
- Sizing advice for each profile’s
memoryandslots, always on. Auto sizing applies it ([sizing] auto, off by default;runnerd initturns it on). - CPU admission: a job waits when the CPUs are spoken for (
[host] cpu_overcommit, off by default).
[host] admission = "caps" turns measured admission off: every runner reserves its profile’s memory, and the budget check holds slots × memory to MemoryMax. runnerd simulate replays your history through both policies and through a CPU budget. Keys: Configuration.
What a job’s memory is
Section titled “What a job’s memory is”Containers are sampled every 2 s, so a shorter spike goes unseen. A job’s memory is memory.current less the file page cache, lower than docker stats. The slice’s memory, which measured admission’s high-water mark reads, is counted as docker stats does. runnerctl job shows sock_throttled, how often the kernel throttled the container’s downloads for want of memory (memory pressure insight).
The host’s memory
Section titled “The host’s memory”A desktop or local builds take RAM the budget assumed was free, and a host short of memory throttles every runner’s sockets. Under either policy runnerd keeps new runners out of that state:
- Every 2 s it reads
MemAvailableand/proc/pressure/memory. The slice may hold what its runners hold now plusMemAvailable, less a margin for the host: the larger of 2G and a sixteenth of the host’s memory. A runner starts only when its reservation fits that beside the running ones’. - Nothing starts while the host has under twice the margin available and every task that could run waits for memory 5% of the time or more over 10 s (
fullpressure), until that falls under 1%. - While jobs wait for the host and none fits that margin, or the host stalls, it grows by half. A job that fits it starts at the next plan, unless a barrier holds it. A job a barrier would let go ahead counts as waiting for the host. A job that lacks CPU too doesn’t count as one that fits: it wouldn’t start under that margin either.
- Running jobs are never stopped.
- A start is admitted once more just before it begins, against what runs and was sampled since the plan. A runner that no longer fits waits; the others start, then the tick plans again from the same listings (at most three times).
Without a recent reading only MemoryMax bounds starts. A waiting job says why and names the programs outside the slice that hold the memory: The host is short of memory shows one and what to do.
What runs can reach that limit while it holds far less than it reserves. The job then waits with the host’s memory free, says so, and names no programs. While a credit stands it says what runs uses and what it keeps for growth:
The host has 42G of 62G available, but what runs may still grow into it: needs 7G; 3.4G of the 49.4G it leaves the slice is freeThe host has 30G of 62G available, but what runs may still grow into it: it uses 14G and keeps 9G for growth; needs 7G, 2G is freeThe status line, the TUI and the dashboard show the host beside the budget (host: 31G of 64G available, swap 12G of 15.5G used; leaves the slice 40G; the swap clause only on a host with swap, and admission counts none of it), and runnerd doctor warns when it has less to spare than the smallest memory.
A host whose memory grows
Section titled “A host whose memory grows”A VM whose hypervisor hands out memory on demand, such as Hyper-V Dynamic Memory, shrinks while idle, so a queued job waits for memory the VM would give. memory_ceiling under [host] says how far the host can grow:
[host]memory_ceiling = "24G"The slice may then also hold memory_ceiling less MemTotal, less the margin of the ceiling (host: 1.48G of 2.12G available, growing to 24G; leaves the slice 21.36G). Set it to MemTotal as the VM reports it at its maximum, lower when other VMs compete for RAM; a ceiling the hypervisor cannot give brings the stalls back.
Measured admission
Section titled “Measured admission”Measured admission, the default, has each runner reserve its job’s predicted peak instead of its cap. It needs the slice to have a MemoryMax: runnerd doctor prints the unit file, and the config check refuses a slice without one. The budget check then holds one runner of each profile with the mirror to it:
[host]admission = "measured" # the default; "caps" reserves every runner's cap
[profiles.node]memory = "7G" # still the container's hard limitslots = 8 # 8 × 7G may exceed MemoryMax- A job (repository, workflow and job name) is predicted from its last 20 runs, or
min_jobswhen that is more, counting any that failed among them: their p95 peak plusmargin, rounded up to 256M. A run that met its cap counts at least its cap. - With fewer runs: the larger of its profile’s p95 and its own largest peak, plus the margin; with none, its profile’s largest peak plus the margin. Once 2 of its runs succeeded, one copy of the job at a time reserves its own largest peak plus the margin instead; a copy queued or running beside another takes the larger. Without
min_jobsruns of the profile, as on a new host, the cap: the first jobs start no more than caps would. - A job whose run met its cap or was killed for memory goes back on its cap until 3 runs in a row succeed clear of it, 7 days at most.
- A runner reserves the largest prediction among the queued jobs its labels match (split light and heavy jobs), then its own job’s once known.
- A running runner counts at the larger of what it reserved and what it last used, or its cap without a recent sample, and at nothing once its container is gone.
- Nothing starts while the slice uses 90% of
MemoryMax, counted asdocker statsdoes.
The caps still stop a container that goes over them, but several jobs going over their predictions at once can fill the slice, and the kernel then kills a process in it. runnerctl job <id> says what a runner reserved and why.
What runs is counted by the growth count, and a job that waited long for memory goes first.