fix: give each instance's Postgres a 12 GB disk image and a 4 GB memory limit

- db disk image 6144 -> 12288 MiB (VOLUMES["db"]): instance 4 had reached
  4.7 GB of its 6 GB and instances kept being recreated when the image filled.
- db memory request/limit 512/2048 -> 1024/4096 MiB (MEMORY["db"]); the
  per-instance totals become 2.375 GiB requested and 11 GiB limit.
- README (disk and memory rows, totals) and the unit tests follow the new
  numbers; release 1.6.5.

Only instances created afterwards get the bigger disk image: existing ones
have to be deleted and created again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Igor K.
2026-11-03 13:45:30 -05:00
co-authored by Claude Opus 5.5
parent e2afacb5fc
commit 711ae36c72
4 changed files with 21 additions and 17 deletions
+8 -7
View File
@@ -109,10 +109,10 @@ class Values(unittest.TestCase):
def test_memory_caps_add_up(self):
req, lim = sp.total_memory_mib()
# db 2048, analytics 1536, kong 768, realtime 768, vector 512, the other seven 512 each
self.assertEqual(lim, 2048 + 1536 + 768 + 768 + 512 + 7 * 512)
self.assertEqual(lim / 1024, 9.0)
self.assertEqual(req, 512 + 11 * 128) # 1.875 GiB
# db 4096, analytics 1536, kong 768, realtime 768, vector 512, the other seven 512 each
self.assertEqual(lim, 4096 + 1536 + 768 + 768 + 512 + 7 * 512)
self.assertEqual(lim / 1024, 11.0)
self.assertEqual(req, 1024 + 11 * 128) # 2.375 GiB
# Measured on three running instances on 2026-09-22; the ceiling has to stay clear of the
# highest use, or the kernel kills the container in a loop the way it did on instance 1.
self.assertGreaterEqual(sp.MEMORY["analytics"][1], 1536) # used 694 MiB, died at 768
@@ -125,8 +125,9 @@ class Values(unittest.TestCase):
self.assertGreaterEqual(sp.DEFAULT_MEMORY[1], 512) # studio used 203 against 256
# The requests stay where they were: the node is shared with production and reserving
# what the instances really use would leave production nothing to schedule into.
# Only db's went up, from 512 to 1024 MiB, with its limit (2026-11-03).
self.assertTrue(all(m[0] == 128 for s, m in sp.MEMORY.items() if s != "db"))
self.assertEqual(req / 1024, 1.875)
self.assertEqual(req / 1024, 2.375)
for svc in sp.SERVICES:
self.assertEqual(self.v["deployment"][svc]["priorityClassName"], "supaspin-low")
self.assertIn("memory", self.v["deployment"][svc]["resources"]["limits"])
@@ -143,7 +144,7 @@ class Values(unittest.TestCase):
def test_volume_caps(self):
p = self.v["persistence"]
self.assertEqual(p["db"]["size"], "6144Mi")
self.assertEqual(p["db"]["size"], "12288Mi")
self.assertEqual(p["storage"]["size"], "1024Mi")
for vol in ("functions", "snippets", "deno", "pgsodium"):
self.assertEqual(p[vol]["size"], "256Mi")
@@ -478,7 +479,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"], "6144Mi")
self.assertEqual(pv["spec"]["capacity"]["storage"], "12288Mi")
self.assertEqual(pv["spec"]["persistentVolumeReclaimPolicy"], "Retain")
self.assertEqual(pv["spec"]["nodeAffinity"]["required"]["nodeSelectorTerms"][0]
["matchExpressions"][0]["values"], ["node1"])