summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-12 19:40:32 +0200
committerSimon Rettberg2016-10-12 19:40:32 +0200
commitac5ba52862a31ae9da83b325fa832cdebb3b90a1 (patch)
tree0a8005c39f00f3ff988d997e1a3898eca0038c16 /remote
parent[run-virt] Remove defunct/unsused fd-loop-image (diff)
downloadtm-scripts-ac5ba52862a31ae9da83b325fa832cdebb3b90a1.tar.gz
tm-scripts-ac5ba52862a31ae9da83b325fa832cdebb3b90a1.tar.xz
tm-scripts-ac5ba52862a31ae9da83b325fa832cdebb3b90a1.zip
[rootfs/hwstats] Use 66% RAM as /tmp tmpfs instead of 60G so we can detect and report when running out of memory
Diffstat (limited to 'remote')
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update9
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions8
2 files changed, 14 insertions, 3 deletions
diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
index 74486508..ff5adc70 100755
--- a/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
+++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
@@ -21,6 +21,13 @@ for SESSION in $(loginctl | awk '{print $1}'); do
fi
done
+# Also report usage of /tmp and swap
+TMP=$(df -P /tmp | grep -m1 ^/tmp)
+TMP_SIZE=$(echo $TMP | awk '{print $2}')
+TMP_FREE=$(echo $TMP | awk '{print $4}')
+SWAP_FREE=$(grep -m1 ^SwapFree: /proc/meminfo | awk '{print $2}')
+
curl -s --data-urlencode "type=~runstate" --data-urlencode "uuid=$UUID" --data-urlencode "used=$USED" \
- --data-urlencode "user=$Name" "$SLX_REMOTE_LOG" > /dev/null 2>&1
+ --data-urlencode "user=$Name" --data-urlencode "tmpsize=$TMP_SIZE" --data-urlencode "tmpfree=$TMP_FREE" \
+ --data-urlencode "swapfree=$SWAP_FREE" "$SLX_REMOTE_LOG" > /dev/null 2>&1
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
index 0c352241..c8e680f0 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
@@ -152,9 +152,13 @@ done
mount -a
-# Make huge tmpfs if nothing could be mounted for /tmp
+# Make tmpfs if nothing could be mounted for /tmp
+# 2016-10-12: Use a sane size of 66% which should be generous enough and prevent the machine from
+# just crashing if RAM is too full. We previously hugely oversized since vmware wants at least as
+# much free space as the VMs RAM; however, this requirement can be disabled with a vmx setting,
+# which we're now doing.
if [ "$HAVE_TEMP" = "no" ]; then
- mount_temp -t tmpfs -o size=60G none
+ mount_temp -t tmpfs -o size=66% none
slxlog "partition-temp" "Running /tmp on tmpfs only!" "/etc/disk.partition"
fi
if [ "$HAVE_SWAP" = "no" ]; then