From df4528d6668ab18e40584fe540355bdfba0fb6dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:29 +0200 Subject: Adding debian version 14.2.21-1. Signed-off-by: Daniel Baumann --- debian/calc-max-parallel.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 debian/calc-max-parallel.sh (limited to 'debian/calc-max-parallel.sh') diff --git a/debian/calc-max-parallel.sh b/debian/calc-max-parallel.sh new file mode 100755 index 00000000..3593955c --- /dev/null +++ b/debian/calc-max-parallel.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Simple tool to calculate max parallel jobs based on +# memory of builder. +# +# MDCache.cc generally runs out of RAM in 4G of memory +# with parallel=4 + +total_ram=$(grep MemTotal /proc/meminfo | awk '{ print $2 }') + +sixtyfour_g=$((64*1024*1024)) +fourtyheight_g=$((48*1024*1024)) +thirtytwo_g=$((32*1024*1024)) +sixteen_g=$((16*1024*1024)) +eight_g=$((8*1024*1024)) +four_g=$((4*1024*1024)) + +if [ ${total_ram} -le ${four_g} ]; then + echo "--max-parallel=1" +elif [ ${total_ram} -le ${eight_g} ]; then + echo "--max-parallel=2" +elif [ ${total_ram} -le ${sixteen_g} ]; then + echo "--max-parallel=3" +elif [ ${total_ram} -le ${thirtytwo_g} ]; then + echo "--max-parallel=6" +elif [ ${total_ram} -le ${fourtyheight_g} ]; then + echo "--max-parallel=8" +elif [ ${total_ram} -le ${sixtyfour_g} ]; then + echo "--max-parallel=12" +else + echo "--max-parallel=16" +fi -- cgit v1.2.3