Files
sencho/docker-compose.yml
T
Anso c613010199 feat: account for VM memory ballooning in host memory reporting (#1750)
* feat: account for VM memory ballooning in host memory reporting

Extend hostMemory.ts with a readBalloonedMemory() function that parses the
Balloon: field from /proc/meminfo, following the same fail-open pattern as
the ZFS ARC integration. When a nonzero balloon is detected, effective
memory fields (effectiveUsed, effectiveFree, effectiveUsagePercent) are
computed and exposed through /api/system/stats and /api/fleet/overview.

All consumers that derive meaning from host memory now prefer effective
values when present: the dashboard gauge, Fleet card RAM bar, mobile
views, health verdict, health status bar stat tile, and host RAM alerts.

Backward compatible: missing /proc/meminfo or absent Balloon: line
preserves exact current behavior. Old remote nodes without the new fields
continue rendering normally.

* refactor: extract shared helpers for balloon memory wiring

Extract readCandidateFile() and logSelectedPath() in hostMemory.ts to
deduplicate ARC and balloon file-read logic. Add memoryToWire() to
centralize the optional-field spread used by /api/system/stats and
/api/fleet/overview. Add getNodeMemUsed()/getNodeMemTotal() helpers
in nodeUtils.ts for frontend byte-text consumers.

* fix: make desktop fleet masthead aggregate balloon-aware

The desktop fleet overview's memory aggregate in useFleetOverview.ts still
summed raw memory.used, while the mobile fleet aggregate and per-node cards
already used effective values. Update to use getNodeMemUsed/getNodeMemTotal
helpers.

* fix: revert balloon adjustment from alerting and health decisions

Ballooned memory is host-reclaimed (unlike ZFS ARC, which the guest can
reclaim on demand). The guest cannot get ballooned pages back until the
hypervisor deflates them, so treating ballooned memory as available for
alerting or health can mask real memory pressure.

Keep balloon parsing, wire fields, and the dashboard context line as
informational-only. The memory gauge, health verdict, and host RAM alerts
now use the standard ARC-adjusted working-set percentage regardless of
balloon. Updated configuration.mdx and dashboard.mdx to document that
balloon data is informational and does not influence alerting.
2026-08-02 20:48:38 -04:00

65 lines
3.2 KiB
YAML

services:
sencho:
image: saelix/sencho:latest
build: .
container_name: sencho
restart: unless-stopped
# Publish only the Sencho UI / API port. Sencho Mesh runs on an internal
# `sencho_mesh` Docker network that Sencho creates and joins on boot,
# so cross-stack mesh routing does not require any extra host ports or
# firewall rules. Override the mesh subnet (default 172.30.0.0/24) with
# SENCHO_MESH_SUBNET if it conflicts with your network.
ports:
- "1852:1852"
volumes:
# Required: Docker Socket for container orchestration
- /var/run/docker.sock:/var/run/docker.sock
# Required: Sencho's internal database for alerts and settings
# Format is [Host Path]:[Container Path]
# You can change the left side to anywhere on your server, but leave the right side as /app/data
- ./data:/app/data
# ⚠️ THE 1:1 COMPOSE PATH RULE ⚠️
# Mount the root folder where all your compose files live.
# The path on the left (Host) MUST EXACTLY MATCH the path on the right (Container).
# EXAMPLE: If your compose files are in /opt/docker, use: - /opt/docker:/opt/docker
- /path/to/your/docker/folder:/path/to/your/docker/folder
# (Optional but Recommended) Media/Data Drives
# Mount your media drives here so Docker Compose inside Sencho can validate paths during deployment.
- /path/to/your/media/drives:/path/to/your/media/drives
# (Optional, ZFS hosts only) OpenZFS ARC stats for ZFS-aware host memory.
# ARC cache is reclaimable but the kernel reports it as used, which can
# trigger false host-memory alerts. Uncomment to let Sencho treat ARC as
# available memory. Usually already visible in the container; only needed
# if your runtime does not expose /proc/spl/kstat/zfs/arcstats.
# - /proc/spl/kstat/zfs/arcstats:/host/proc/spl/kstat/zfs/arcstats:ro
# VM ballooning: mount /proc/meminfo if your runtime does not expose it.
# - /proc/meminfo:/host/proc/meminfo:ro
environment:
# ENVIRONMENT VARIABLES FOR INSIDE THE CONTAINER
# This points to the Container Path (right side) of your 1:1 mount above
- COMPOSE_DIR=/path/to/your/docker/folder/compose
# This points to the Container Path (right side) of your database mount above. Leave this as /app/data.
- DATA_DIR=/app/data
# (Optional, ZFS hosts only) Container-side path to the OpenZFS ARC stats
# file, if it is not at a standard location. Leave empty to auto-detect
# /host/proc/spl/kstat/zfs/arcstats then /proc/spl/kstat/zfs/arcstats.
- SENCHO_ZFS_ARCSTATS_PATH=${SENCHO_ZFS_ARCSTATS_PATH:-}
# Optional: mount /proc/meminfo for VM memory ballooning awareness
# - /proc/meminfo:/host/proc/meminfo:ro
- SENCHO_PROC_MEMINFO_PATH=${SENCHO_PROC_MEMINFO_PATH:-}
# ⚠️ GLOBAL ENVIRONMENT VARIABLES ⚠️
# If your compose files rely on host-level shell variables (like $PUID, $TZ)
# or a centralized globals.env file, you MUST pass them into Sencho here.
# Otherwise, Sencho will evaluate your compose files with empty variables.
# If you do not use a global env file, you can delete these two lines.
env_file:
- /path/to/your/docker/folder/env/globals.env