aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-build-coordinator/utils.scm9
-rw-r--r--scripts/guix-build-coordinator-agent.in3
2 files changed, 3 insertions, 9 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm
index 2b098e5..91dcb07 100644
--- a/guix-build-coordinator/utils.scm
+++ b/guix-build-coordinator/utils.scm
@@ -54,8 +54,7 @@
with-timeout
- get-load-average
- get-available-processing-units))
+ get-load-average))
(define (random-v4-uuid)
;; https://tools.ietf.org/html/rfc4122#page-14
@@ -707,9 +706,3 @@ again."
((= period 5) 5min)
((= period 15) 15min))))))
#f))
-
-(define (get-available-processing-units)
- (let* ((port (open-input-pipe "nproc --all"))
- (str (read-line port)))
- (close-pipe port)
- (string->number str)))
diff --git a/scripts/guix-build-coordinator-agent.in b/scripts/guix-build-coordinator-agent.in
index 96c49c1..e8a2f0c 100644
--- a/scripts/guix-build-coordinator-agent.in
+++ b/scripts/guix-build-coordinator-agent.in
@@ -24,6 +24,7 @@
(use-modules (srfi srfi-1)
(srfi srfi-37)
+ (ice-9 threads)
(ice-9 textual-ports)
((guix config) #:prefix guix-config:)
(guix-build-coordinator utils)
@@ -97,7 +98,7 @@
(metrics-file
. "/var/lib/prometheus/node-exporter/guix-build-coordinator-agent.prom")
(max-1min-load-average
- . ,(max (- (get-available-processing-units) 1)
+ . ,(max (- (total-processor-count) 1)
1))))
(define (parse-options options defaults args)