Documentation
¶
Overview ¶
Command hostload says how busy a host's CPUs are right now, from two readings of /proc/stat, and which CPUs are the idlest -- the check to run before a measurement, and the CPU to pin it to.
It exists because the load average answered the wrong question twice. On a Loongson (cfarm401) it read 146 while every CPU was idle: 146 processes stuck in uninterruptible sleep count toward the load and use no CPU. On a Zen 3 guest (cfarm421) a quiet load hid a third of the CPU time going to other users' niced jobs. Both were found only by diffing /proc/stat by hand, in throwaway scripts; this is that diff with a home and tests.
⛔ /proc/stat IS LINUX, and this fleet's sessions run on a Mac. Asked for the busy shares where there is no /proc/stat, the command used to print
hostload: open /proc/stat: no such file or directory
which reads like a broken host rather than an unsupported platform (#221). It now names the platform and what CAN be asked there: --max-load, the 1-minute load average, which the loadavg package reads on Linux and macOS alike. That measure is only ever used where the caller asks for it BY NAME, because it is the weaker one -- the two paragraphs above are what it got wrong -- and the refusal says so every time it answers from it.