Skip to content

ops: mempalace-backup.service OOM-killed mid-dump — free RAM during nightly pg_dump #87

Description

@jphein

Symptom

mempalace-backup.service (nightly pg_dump of the 410K-drawer palace) has been failing — so the production palace had no recent successful backup.

Root cause (NOT corruption)

Logs from the 2026-05-29 02:15 run:

earlyoom[8860]: mem avail: 1360 of 15893 MiB (8.56%) ... low memory!
earlyoom[8860]: sending SIGTERM to process 2043104 "postgres" badness 702, VmRSS 1285 MiB
mempalace-db: FATAL: terminating connection due to administrator command
  STATEMENT: COPY public.mempalace_drawers (id, document, embedding, metadata, wing, room) TO stdout;

earlyoom (userspace OOM daemon) SIGTERMs the postgres backend doing the dump when whole-host free RAM drops below ~10%. familiar has only 15.5G RAM; llama-server (3.1G) + mempalace-db (6g cgroup) + palace-daemon + kg-extract + familiar-api oversubscribe it. The embedding-laden COPY of 410K rows spikes RSS just enough to tip an already-saturated host.

Data is fine. With llama-server stopped (RAM freed to 12G avail), a manual pg_dump | gzip read all 410K drawer rows cleanly in 42s → verified 1.2G backup now at /mnt/archive/backups/. The clean read also confirms no corruption in mempalace_drawers.

Fix options (cheapest first)

  1. Backup script stops llama-server for the dump window, then restarts it (kg-extract retries via the #307 transient-retry path). Simplest, fully reclaims the 3.1G that tips the host.
  2. nice/ionice + a memory cap on the dump, or stream straight to /mnt/archive (local) instead of a slow share.
  3. Reduce host RAM pressure structurally — move llama-server / kg-extract off familiar (see ops: evaluate moving palace-daemon and/or kg-extract worker off familiar #62).

Recommend (1) for an immediate fix + (3) for the durable one.

Related

  • familiar.realm.watch#62 (move services off the RAM-starved host)
  • mempalace#243 (DB-on-SSD decision; backup captured during that investigation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions