mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/gnu: Limit load average.
A nice feature of offload builds is that Guix will throttle the start of new jobs based on the overload-threshold. There is no equivalent for local builds, so one must either run builds in serial (--max-jobs=1) and endure single-threaded builds or run concurrent builds and watch the system overload as it runs multiple multi-threaded builds. From a benchmark comparing the compilation of concurrent Folly builds, the "max-load" option reduced the overall time by 8.3%. Memory use also drops considerably since we are only running 1/4 of the processes at any time. * guix/build/gnu-build-system.scm (build, check): Set max load. Change-Id: I97f1e3e59880b6ed23faed2038eb5279415e9c95 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
e239958b8b
commit
b2a20e5fd9
1 changed files with 7 additions and 2 deletions
|
@ -28,6 +28,7 @@
|
||||||
#:use-module (ice-9 regex)
|
#:use-module (ice-9 regex)
|
||||||
#:use-module (ice-9 format)
|
#:use-module (ice-9 format)
|
||||||
#:use-module (ice-9 ftw)
|
#:use-module (ice-9 ftw)
|
||||||
|
#:use-module (ice-9 threads)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-19)
|
#:use-module (srfi srfi-19)
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
|
@ -386,7 +387,9 @@ makefiles."
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
(apply invoke "make"
|
(apply invoke "make"
|
||||||
`(,@(if parallel-build?
|
`(,@(if parallel-build?
|
||||||
`("-j" ,(number->string (parallel-job-count)))
|
`("-j" ,(number->string (parallel-job-count))
|
||||||
|
,(string-append "--max-load="
|
||||||
|
(number->string (total-processor-count))))
|
||||||
'())
|
'())
|
||||||
,@make-flags)))
|
,@make-flags)))
|
||||||
|
|
||||||
|
@ -425,7 +428,9 @@ makefiles."
|
||||||
(raise c)))
|
(raise c)))
|
||||||
(apply invoke "make" test-target
|
(apply invoke "make" test-target
|
||||||
`(,@(if parallel-tests?
|
`(,@(if parallel-tests?
|
||||||
`("-j" ,(number->string (parallel-job-count)))
|
`("-j" ,(number->string (parallel-job-count))
|
||||||
|
,(string-append "--max-load="
|
||||||
|
(number->string (total-processor-count))))
|
||||||
'())
|
'())
|
||||||
,@make-flags)))
|
,@make-flags)))
|
||||||
(format #t "test suite not run~%")))
|
(format #t "test suite not run~%")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue