summary refs log tree commit diff
path: root/tests/snix.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-03 01:17:54 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-08 10:57:12 -0400
commitefbf5fdd01817ea75de369e3dd2761a85f8f7dd5 (patch)
tree838fc350da78007766b8ec725b35fef1a824f20d /tests/snix.scm
parent01f9a4c0f23e23e1e626007e6ead948923a23a0d (diff)
downloadguix-efbf5fdd01817ea75de369e3dd2761a85f8f7dd5.tar.gz
offload: Improve load normalization and configurability.
Fixes <https://issues.guix.gnu.org/43773>.

The computed normalized load was previously obtained by dividing the load
average as found in /proc/loadavg by the number of parallel builds defined for
a build machine.

This normalized load didn't allow to compare machines with different number of
cores, as the load average reported by /proc/loadavg can be as high as the
number of cores; thus comparing that value to a fixed threshold of 2.0 would
mean machines with multiple cores were more likely to be flagged as overloaded
compared to single core machines.

This can be fixed by normalizing using the available number of cores instead
of the number of parallel jobs.

* guix/scripts/offload.scm (<build-machine>)[overload-threshold]: New field.
(node-load): Modify to return a normalized load value between 0 and 1, taking
into account the number of cores available.
(normalized-load): Remove procedure.
(report-load): New procedure.
(choose-build-machine): Adjust to use the modified 'node-load' and the new
'report-load' and 'build-machine-overload-threshold' procedures.
(check-machine-status): Adjust.
* doc/guix.texi (Daemon Offload Setup): Document the offload scheduler and the
new 'overload-threshold' field.
Diffstat (limited to 'tests/snix.scm')
0 files changed, 0 insertions, 0 deletions