From 340dc99e029d83bc777291555b4da7a588119021 Mon Sep 17 00:00:00 2001 From: Nick <126941599+coo1white@users.noreply.github.com> Date: Sun, 19 Jul 2026 12:17:31 +0700 Subject: [PATCH] fix(deploy): pass the documented postgres tuning values to postgres MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deploy/.env.example documents POSTGRES_MAX_CONNECTIONS, POSTGRES_SHARED_BUFFERS, POSTGRES_EFFECTIVE_CACHE_SIZE and POSTGRES_MAINTENANCE_WORK_MEM, with notes on how to size them — but no compose file ever passes them to the postgres container. A user who sets them in .env gets nothing, silently. Wire them into the postgres command in deploy/docker-compose.yml. The fallbacks are the postgres:18 stock defaults (100 / 128MB / 4GB / 64MB), so a deploy that does not set the variables behaves exactly as before. Checked with postgres:18-alpine: with the variables unset, SHOW gives the stock values; with them set (1024 / 1GB / 6GB / 128MB), SHOW gives the set values. Co-Authored-By: Claude Fable 5 --- deploy/docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index e60776e58..b90c1ac33 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -202,6 +202,15 @@ services: nofile: soft: 100000 hard: 100000 + # Pass the tuning values documented in .env.example to postgres. The + # fallbacks are the postgres:18 stock defaults, so nothing changes when + # the variables are not set. + command: > + postgres + -c max_connections=${POSTGRES_MAX_CONNECTIONS:-100} + -c shared_buffers=${POSTGRES_SHARED_BUFFERS:-128MB} + -c effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-4GB} + -c maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-64MB} volumes: - postgres_data:/var/lib/postgresql/data environment: