From b1ae4f1daae2149d9cc74e4f1901e158352367b7 Mon Sep 17 00:00:00 2001 From: "Igor K." Date: Wed, 14 Oct 2026 08:46:50 -0400 Subject: [PATCH] fix: make the database disk image 6 GB instead of 2 GB - VOLUMES["db"] goes from 2048 to 6144 MiB, so every new instance gets a 6 GB database image. Instance 4 filled its 2 GB image with analytics logs on 2026-10-14: Postgres crashed and could not finish crash recovery without free space. Instance 2 had already been grown to 6 GB by hand. - Measured on instance 2: about 1.2 GB of logs a day under browser-test traffic, kept for LOG_RETENTION (2 days), plus up to 1 GB of write-ahead log. That peaks near 4.5 GB. - Only instances created after this change get the larger image; existing ones keep their size. - README disk line, the two unit tests that assert the db volume size, and the version (1.6.3 -> 1.6.4 in VERSION, supaspin and README.md) are updated. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 4 ++-- VERSION | 2 +- supaspin | 7 +++++-- tests/test_supaspin.py | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 10e5a01..3a140cb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # supaspin -Version 1.6.3 +Version 1.6.4 Create, list, show and delete throwaway [Supabase](https://supabase.com) instances on a single-node [microk8s](https://microk8s.io) server, from a terminal menu. @@ -16,7 +16,7 @@ endangering them. Nothing in it is specific to any one app. | Web API | `https://` (auth, rest, graphql, realtime, storage, functions); the certificate is from Let's Encrypt when that is enabled, otherwise self-signed | | Postgres | `:544N` (instance 1 → 5441, 2 → 5442, …); which addresses listen is set by **Port bind** | | Studio (admin UI) | `http://:300N` (3001, 3002, …), not on the public hostname | -| Disk | fixed-size ext4 image files, mounted at boot: **db 2 GB, storage 1 GB, every other volume 256 MB** | +| Disk | fixed-size ext4 image files, mounted at boot: **db 6 GB, storage 1 GB, every other volume 256 MB** | | Memory | limits add up to **9 GiB** per instance, requests to 1.875 GiB (table below) | | Priority | pods run at priority -100 (`supaspin-low`); when the server runs short of memory they are evicted first and never evict anyone else | | Secrets | generated fresh per instance: JWT secret, anon and service keys, Postgres password, Studio password, and the internal keys | diff --git a/VERSION b/VERSION index 266146b..9edc58b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3 +1.6.4 diff --git a/supaspin b/supaspin index 3e17690..a1dde43 100755 --- a/supaspin +++ b/supaspin @@ -39,7 +39,7 @@ import tty import yaml -VERSION = "1.6.3" +VERSION = "1.6.4" CONFIG_PATH = os.environ.get("SUPASPIN_CONFIG", "/etc/supaspin/config.yaml") STATE_DIR = os.environ.get("SUPASPIN_STATE", "/var/lib/supaspin") CHART_REPO = "https://supabase-community.github.io/supabase-kubernetes" @@ -53,7 +53,10 @@ CERTS_NS = "supaspin-certs" # Image cap per volume, in MiB. The chart's separate imgproxy volume is not used: imgproxy has to # read the uploaded files, so it mounts the storage volume instead (see instance_values). -VOLUMES = {"db": 2048, "storage": 1024, "functions": 256, +# The db image is 6 GB because of the analytics logs: browser-test traffic wrote about 1.2 GB of +# logs a day on instance 2 (2026-10-14), the nightly cleanup keeps LOG_RETENTION of them, and the +# write-ahead log may take up to 1 GB on top. That peaks near 4.5 GB; 2 GB filled up on instance 4. +VOLUMES = {"db": 6144, "storage": 1024, "functions": 256, "snippets": 256, "deno": 256, "pgsodium": 256} # The user Postgres runs as inside supabase/postgres 17.6.1.136 (`id postgres` in the image). # Production's older image used 2000; do not copy that number. diff --git a/tests/test_supaspin.py b/tests/test_supaspin.py index 25d75b2..338d608 100644 --- a/tests/test_supaspin.py +++ b/tests/test_supaspin.py @@ -143,7 +143,7 @@ class Values(unittest.TestCase): def test_volume_caps(self): p = self.v["persistence"] - self.assertEqual(p["db"]["size"], "2048Mi") + self.assertEqual(p["db"]["size"], "6144Mi") self.assertEqual(p["storage"]["size"], "1024Mi") for vol in ("functions", "snippets", "deno", "pgsodium"): self.assertEqual(p[vol]["size"], "256Mi") @@ -478,7 +478,7 @@ class Manifests(unittest.TestCase): pv = sp.pv_manifest(CFG, 2, "db") self.assertEqual(pv["spec"]["claimRef"], {"namespace": "supaspin-2", "name": "supa2-supabase-db"}) self.assertEqual(pv["spec"]["local"]["path"], "/data/supabase/2/db/data") - self.assertEqual(pv["spec"]["capacity"]["storage"], "2048Mi") + self.assertEqual(pv["spec"]["capacity"]["storage"], "6144Mi") self.assertEqual(pv["spec"]["persistentVolumeReclaimPolicy"], "Retain") self.assertEqual(pv["spec"]["nodeAffinity"]["required"]["nodeSelectorTerms"][0] ["matchExpressions"][0]["values"], ["node1"])