c885b5acf4
Measured on demo-felhom (N100, 16 GB): 61 apps deployed and removed through the product, sampled every 5 s; heavy apps with one real action (Immich 200 photos, Jellyfin transcode, Paperless OCR, Nextcloud 500 MB, ...). sizing.json for the estimator (tools/build_sizing.py), SIZING.md with the proposed minimum machine, METHOD.md. Power is RAPL CPU-package only (no meter). R-993 asks the operator to approve the minimum machine; R-994 lists catalog limits/requests that are too low; R-995 records leftover unnamed volumes after removal. R-231's dated check measured: dooplex-backup.service success, journal green.
19 lines
1.3 KiB
Bash
Executable File
19 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# host_sampler.sh TAG [VMID] — runs on the Proxmox HOST. Every 5 s:
|
|
# ts rapl_pkg_uj mem_total_kb mem_available_kb guest_mem_current guest_anon pkg_temp_mC cpu_busy_jiffies cpu_total_jiffies
|
|
# rapl_pkg_uj = Intel RAPL package energy counter (CPU package only — NOT wall power).
|
|
# Stops when /root/sizing/stop-TAG exists. Read-only: it writes only its own TSV.
|
|
TAG=${1:?tag}; VMID=${2:-9201}; D=/root/sizing; mkdir -p "$D"; OUT="$D/host-$TAG.tsv"; rm -f "$D/stop-$TAG"
|
|
R=/sys/class/powercap/intel-rapl:0/energy_uj; CG=/sys/fs/cgroup/lxc/$VMID
|
|
T=$(for h in /sys/class/hwmon/hwmon*; do [ "$(cat $h/name)" = coretemp ] && echo $h/temp1_input; done | head -1)
|
|
echo -e "ts\trapl_pkg_uj\tmem_total_kb\tmem_available_kb\tguest_mem_current\tguest_anon\tpkg_temp_mC\tcpu_busy\tcpu_total" > "$OUT"
|
|
while [ ! -e "$D/stop-$TAG" ]; do
|
|
now=$(date +%s); e=$(cat $R 2>/dev/null || echo 0)
|
|
mt=$(awk '/^MemTotal/{print $2}' /proc/meminfo); ma=$(awk '/^MemAvailable/{print $2}' /proc/meminfo)
|
|
gc=$(cat $CG/memory.current 2>/dev/null || echo 0); ga=$(awk '$1=="anon"{print $2}' $CG/memory.stat 2>/dev/null)
|
|
t=$(cat "$T" 2>/dev/null || echo 0)
|
|
read -r busy total < <(awk '/^cpu /{b=$2+$3+$4+$7+$8+$9; t=b+$5+$6; print b,t}' /proc/stat)
|
|
echo -e "$now\t$e\t$mt\t$ma\t$gc\t${ga:-0}\t$t\t$busy\t$total" >> "$OUT"
|
|
sleep 5
|
|
done
|