hostload

command
v0.150.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL