Lower backup/restore RAM safety threshold 1536MB -> 1024MB

Investigated a resource-safety abort during Odoo restore testing:
available RAM was hovering ~1.3-1.5GB even under normal conditions on
this host (k3s + Jenkins + Docker monitoring/wazuh stack + dev tooling
baseline), not a leak from any single process. 1536MB was tripping on
ordinary single-app backups; 1024MB still leaves real headroom above
what a pg_dump/mysqldump/tar step actually needs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017avLHFqkiti3g62Anq9sVA
This commit is contained in:
root
2026-08-21 01:43:37 +02:00
parent 4dd4b8ef9b
commit 49b68cf820
2 changed files with 12 additions and 3 deletions

View File

@@ -156,8 +156,14 @@ check_resources() {
# management-platform pod's minimal image, /proc/meminfo always is. # management-platform pod's minimal image, /proc/meminfo always is.
avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo) avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo)
avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}') avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}')
if [ "$avail_mb" -lt 1536 ]; then # Threshold lowered 1536->1024MB 2026-08-21: this host's steady-state
echo " ❌ RAM available ${avail_mb}MB < 1536MB threshold — aborting." # available RAM sits ~1.3-1.5GB even when idle (k3s + Jenkins + Docker
# monitoring/wazuh stack + dev tooling baseline) — investigated, no
# single runaway process, just genuine multi-service baseline. 1536MB
# was tripping on ordinary single-app backups. 1024MB still leaves
# real headroom above what a pg_dump/mysqldump/tar op actually needs.
if [ "$avail_mb" -lt 1024 ]; then
echo " ❌ RAM available ${avail_mb}MB < 1024MB threshold — aborting."
log_status "FAILED" "$BACKUP_NAME" "resource_safety_ram_${avail_mb}mb" log_status "FAILED" "$BACKUP_NAME" "resource_safety_ram_${avail_mb}mb"
exit 1 exit 1
fi fi

View File

@@ -122,7 +122,10 @@ check_resources() {
# management-platform pod's minimal image, /proc/meminfo always is. # management-platform pod's minimal image, /proc/meminfo always is.
avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo) avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo)
avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}') avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}')
if [ "$avail_mb" -lt 1536 ] || [ "$avail_gb" -lt 10 ]; then # Threshold lowered 1536->1024MB 2026-08-21 — see backup-k8s-apps.sh
# check_resources() comment for the investigation (baseline host RAM,
# not a leak).
if [ "$avail_mb" -lt 1024 ] || [ "$avail_gb" -lt 10 ]; then
echo " ❌ Resource safety threshold hit (RAM=${avail_mb}MB, Disk=${avail_gb}GB) — aborting." echo " ❌ Resource safety threshold hit (RAM=${avail_mb}MB, Disk=${avail_gb}GB) — aborting."
exit 1 exit 1
fi fi