Expand description
Right-sizing advice from the job history: the spread of each profile’s and each job’s sampled peaks, waits and
slot use, and the memory and slots to set. Pure: the store reads the history, the daemon serves the result
(api::Sizing). It never changes the config: a client applies advice through PUT /v1/config, which validates
it like any other config, and under [sizing] auto the daemon applies what auto::changes picks the same way.
Modules§
- auto
- Auto sizing: which profiles’
memory,slotsandcpusthe daemon changes now, from the advice, the runs since each profile’s last change and the limits[sizing]and each profile set. Pure: the daemon reads the history and when each profile last changed, writes each change through the config check asPUT /v1/configdoes, and records it. Never lowers a profile while a job is on its cap, never changesmemoryfrom fewer than[sizing] min_jobsjobs, never lowers within[sizing] intervalof a profile’s last change or raises withinraise_interval, never leaves a profile outside its bounds, and sizes each profile against the budget the changes before it in the same look leave. Readscpusonly from runs at the profile’s currentcpussince its last change and since the daemon got them. Undercapsadmission raises them only on those runs’ CPU averages, never on peaks: a parallel build peaks at whatever cap it gets, and therecpustake budget. Undermeasured, where a running job reserves its average, runs the cap held back raise them too, within what the CPU budget holds at caps, and nothing lowers them. Undercapslowers them only when the cap held none of those runs back, never under their highest peak. A run the cap held back is one its quota throttled in 15% of its run or more, or, without that figure, one whose bursts met the cap (ADRs 0075 and 0079); undermeasureda raise goes on only while the one before made the job’s runs faster or less throttled. - memory
- What a profile’s runs say about its
memory(ADR 0070): each job’s sizing window (admission::recent), what a raise needs (raise_need: only runs that met the current cap since the profile took it), what a lowering must stay above (lower_floor: every windowed run’s need), and a lowering auto sizing made that went too far, which is reverted. Pure;adviseand auto sizing read it, never a client.
Structs§
- CpusSet
- A profile’s
cpusas the daemon ran it fromat(ms), by itsprofile.changedevent: one when it started with the profile, and after each reload or restart that changed the profile’s image, CPUs, memory or slots. - Held
- One runner container’s time in a slot for a job. Times in milliseconds.
- History
- What the store reads for sizing.
- LeftOut
- The jobs queued in a window that no replay can run, as it has no run time for them.
- Memory
Set - A profile’s
memoryas the daemon ran it fromat(ms), by itsprofile.changedevent, asCpusSethas itscpus. - Ran
- One finished job of this daemon’s runners, as sizing reads it. Times in milliseconds.
- Slots
Set - A profile’s
slotsas the daemon ran them fromat(ms), by itsprofile.changedevent, asCpusSethas itscpus. - Throttling
- What a run’s CPU quota did to it, as auto sizing and insights read it (ADR 0079). Times in milliseconds.
- Wait
- A job’s wait for a runner as sizing, insights and the history’s figures count it: from when GitHub queued it, or
from when the history holds every job if that came later (
history_kept), as for a job queued before runnerd first ran, to when it started, less what of it passed while no runnerd ran (ADR 0081). A job’s own page shows its whole wait, as GitHub’s does; arrivals, assimulateand warm runners model them, go byqueued_at. - Window
- What
advisesizes against besides the history.
Enums§
- Capped
- What a run says about its container’s memory cap (ADR 0070).
- Measure
- What a run’s sampled memory counts.
Constants§
- HELD
- A run its CPU quota throttled in this share of its run or more, in percent, was held back by its cap: it ran as
fast as the cap let it, so its average says what the cap allowed. No lowering reads it, under
measuredadmission it raises the cap, and insights name its job (ADR 0079). The share is of the run’s wall time in 100 ms periods, not of the periods the kernel counted, which leave out the time it was idle: a job that waits on the network for most of its run and bursts past its cap in a few compiles is throttled in most of its busy periods and in little of its run. A throttled period loses only part of its 100 ms, so the share is more than the time the cap cost. The Android quality gate lost about 90 s of its 517 at 9 CPUs, 17% of its run, and was throttled in 28% of it, 21% at 13 and 16% at 19; an 8-minute job whose three 20-second compiles want 20 CPUs is throttled in 11%, and lost about 6%.
Functions§
- advise
- The advice for every profile of
configfromhistory, against the slice’smemory_maxasconfig’s admission policy budgets it. Peaks, and the memory advice, go by each job’s sizing window over the history’s last 30 days (memory, ADR 0070);window.sincenarrows only the waits, the busy share and the starts.