diff --git a/apps/gittensory-ui/src/routes/docs.self-hosting-backup-scaling.tsx b/apps/gittensory-ui/src/routes/docs.self-hosting-backup-scaling.tsx index 117ab0b10b..df9691907c 100644 --- a/apps/gittensory-ui/src/routes/docs.self-hosting-backup-scaling.tsx +++ b/apps/gittensory-ui/src/routes/docs.self-hosting-backup-scaling.tsx @@ -60,6 +60,31 @@ LITESTREAM_REGION=us-east-1`}

+

Retention: how many backups are kept

+

+ Each run keeps the newest BACKUP_RETAIN backups (default 7) — + applied independently per target: postgres/, sqlite/, and{" "} + qdrant/ in the gittensory-backups volume each retain their own + newest 7, not 7 combined across all three. Set it in .env to change the window: +

+ +

+ scripts/backup.sh's normalize_backup_retain guards against + misconfiguration rather than failing the run: a non-numeric or empty value falls back to 7 + with a logged warning, and BACKUP_RETAIN=0 is coerced up to 1 (a retention + window of zero would delete the backup the script just took, so the script refuses that + rather than leaving you with nothing). +

+ + If the SQLite online backup fails verification — the .backup command itself + fails, the output file is empty, or its PRAGMA integrity_check doesn't come + back ok — the script deletes the bad output, logs the failure, and — critically + — skips the retention prune for the sqlite target on that run, so a broken + backup can never push a known-good one out of the retained window. Postgres and Qdrant + retention still run normally on that same pass, since only the SQLite leg failed. The run + still exits non-zero so the failure is loud. + +

Multi-instance: Postgres and Redis

+

Capacity planning: how much disk for N repos at M PRs/month

+

+ The 151GB host above is one measured point, not a formula. It says nothing about how disk + use grows as you register more repos or review more pull requests — for that you have to + reason about which tables and volumes actually grow with activity, versus which are fixed + overhead. Treat every number below as an order-of-magnitude estimate to plan around, not a + guarantee. +

+ +

+ Putting it together: for a small install (a handful of repos, tens of PRs/month), all of + this is noise against the ~20GB of fixed Docker/image/volume overhead measured above — you + will not notice review_audit or webhook_events growth for a long time. The estimate gets + real at higher volume: an install running hundreds of PRs/month across dozens of repos, left + unattended for a year or more, is a plausible case where the unbounded tables above (and the + backups that multiply them) become the dominant long-term disk driver rather than Docker + images and build cache. There is no first-party tool yet to prune review_audit or + webhook_events — if you operate at that scale, monitor their row counts directly ( + SELECT count(*) FROM review_audit,{" "} + SELECT count(*) FROM webhook_events) rather than assuming steady state. +

+

Docker resource hygiene

Every service in docker-compose.yml caps its own container logs (10MB × 3