]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-*-build: evaluate num jobs using total mem not free mem 1116/head
authorKefu Chai <kchai@redhat.com>
Thu, 6 Sep 2018 11:44:52 +0000 (19:44 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 6 Sep 2018 11:44:56 +0000 (19:44 +0800)
there is chance that the system is under extremely high load when `vmstat`
is called. so the "free memory" can not reflect the available memroy
when building Ceph. so use "total memory" instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
scripts/build_utils.sh

index 64df4c55d0e68d06a110bf7f1a0239c0bfee6568..d1f828c832f1d1076935e7e6d89506ebed40b7b1 100644 (file)
@@ -835,7 +835,7 @@ get_nr_build_jobs() {
     # assume each compiling job takes 1800 MiB memory on average
     local nproc=$(nproc)
     local max_build_jobs=$(vmstat --stats --unit m | \
-                               grep 'free memory' | \
+                               grep 'total memory' | \
                                awk '{print int($1/1800)}')
     if [[ $max_build_jobs -eq 0 ]]; then
         # probably the system is under high load, use a safe number