pub fn changes(
config: &Config,
history: &History,
context: Context<'_>,
) -> Vec<SizingChange>Expand description
The changes to make now, in order, one per profile at most. Empty unless [sizing] auto is on.
A change that lowers memory or cpus waits [sizing] interval after the profile’s last change; one that only
raises waits raise_interval. A lowering moves memory toward the advice, and cpus move toward what their runs
reach, by at most [sizing] max_step percent; a raise of memory goes straight to the advice, which only a run
that met the cap gives. memory stays within the profile’s min_memory and max_memory, cpus within the
slice’s CPUs. A lowering that went too far is taken back at once (ProfileSizing::revert). A profile whose jobs
waited for a slot, or whose slots were busy, since its last change gets one more slot when every profile’s slots
still fit MemoryMax: at their caps under caps admission, at their jobs’ p95 peaks under measured; at most
max_slots when set, and never under what runs. Under caps a lowered memory adds the slots the advice gives. Each change is sized as if the ones before it were written: they take
budget the later ones cannot.
cpus go up max_step percent, at least 1, when one job’s runs at them since the profile’s last change and since
the daemon got them (Context::cpus_set), 3 at least, averaged BOUND percent of them at the median; up to the slice’s CPUs, and under caps with a CPU budget
only as far as every profile’s slots × cpus fit it. They come down, interval after the last change and by
max_step percent at most, toward HEADROOM times the heaviest job’s p95 average, rounded up to whole CPUs, at
least 1, once min_jobs such runs say so and every job among them has a measured average. Only successful runs
with a measured average count; see next_look for the raises it cannot make.