lotus-land-story: lower restic GC target to dodge OOM
Assisted-by: Claude Opus 5.5 via Claude Code
change lvlmxpvttvomktkxnryvzqoykvxrqokt
commit bc4aaae192e1b66984d96354021026da4bef4a2a
author Alpha Chen <alpha@kejadlen.dev>
date
parent wwqnvkvp
diff --git a/docs/backup.md b/docs/backup.md
index 208cd19..d1e1fad 100644
--- a/docs/backup.md
+++ b/docs/backup.md
@@ -10,7 +10,9 @@ one day of backups.
 `/etc/cron.daily/backup` on lotus-land-story (templated from
 `lotus-land-story/templates/backup.sh`, owned by the play in
 `lotus-land-story/backup.yml`) runs as root. cron has no MTA, so the script
-sends its own output to the journal with the `backup` tag. Each run:
+sends its own output to the journal with the `backup` tag. It sets
+`GOGC=20` so restic trades CPU for memory, since lotus-land-story has little
+headroom and the OOM killer has taken restic mid-backup. Each run:
 
 1. Pings healthchecks.io `/start`, distinguishing a run that died early from
    one that never fired.
@@ -27,7 +29,7 @@ sends its own output to the journal with the `backup` tag. Each run:
 
 An exit trap pings healthchecks.io with success or failure and pushes
 `backup_*` metrics to VictoriaMetrics. Telemetry failures never change the
-script's own exit status, but the copy in step 5 does count toward it: a
+script's own exit status, but the copy in step 6 does count toward it: a
 broken mirror fails the run.
 
 ## Repositories
diff --git a/lotus-land-story/templates/backup.sh b/lotus-land-story/templates/backup.sh
index 86c94d3..57c1a66 100644
--- a/lotus-land-story/templates/backup.sh
+++ b/lotus-land-story/templates/backup.sh
@@ -8,6 +8,9 @@ readonly SECONDARY_REPOSITORY={{ secondary_repository }}
 export RESTIC_REPOSITORY=${PRIMARY_REPOSITORY}
 export RESTIC_PASSWORD={{ restic.password }}
 
+# Trades CPU for memory; the host's headroom is thin enough to OOM restic.
+export GOGC=20
+
 readonly HEALTHCHECK=https://hc-ping.com/{{ healthchecks_io.backup_sh }}
 readonly METRICS=https://metrics/api/v1/import/prometheus