[-]
[+]
|
Changed |
j0ke-worker.changes
|
|
[-]
[+]
|
Changed |
j0ke-worker.spec
^
|
|
[-]
[+]
|
Changed |
obsworker
^
|
@@ -111,15 +111,30 @@
if [ "$OBS_WORKER_INSTANCES" -gt 0 ]; then
NUM="$OBS_WORKER_INSTANCES"
else
+ # define hostsystem memory
+ case "$(lsb_release -r | awk '{print $NF}')" in
+ 11)
+ HOSTMEM=1572864
+ ;;
+ 12.3)
+ HOSTMEM=1835008
+ ;;
+ 13.1)
+ HOSTMEM=2097152
+ ;;
+ *)
+ HOSTMEM=2097152
+ ;;
+ esac
# start one build backend per CPU
NUM=`grep ^processor /proc/cpuinfo | wc -l`
# get total system memory and check if there is enough space for running
# CPUCOUNT * XENMEM + RAMDDISK Workers
- MEM=$(cat /proc/meminfo | grep ^MemTotal: | awk -v NUM=${NUM} -v XENMEM=${XEN_MEMX} '{print $2 - (XENMEM * 1024*NUM+1572864) }')
+ MEM=$(cat /proc/meminfo | grep ^MemTotal: | awk -v NUM=${NUM} -v XENMEM=${XEN_MEMX} -v HM=${HOSTMEM} '{print $2 - (XENMEM * 1024*NUM+HM) }')
if [ -n "${MEM}" ] ; then
until [ ${MEM} -gt 0 ] ; do
NUM=`expr ${NUM} - 1`
- MEM=$(cat /proc/meminfo | grep ^MemTotal: | awk -v NUM=${NUM} -v XENMEM=${XEN_MEMX} '{print $2 - (XENMEM * 1024*NUM+1572864) }')
+ MEM=$(cat /proc/meminfo | grep ^MemTotal: | awk -v NUM=${NUM} -v XENMEM=${XEN_MEMX} -v HM=${HOSTMEM} '{print $2 - (XENMEM * 1024*NUM+HM) }')
done
fi
#if [ "${NUM}" -gt 1 ] ; then
|