From c9a9c0155e2312ded1b6e7d427a25f0acdb74b21 Mon Sep 17 00:00:00 2001 From: Daan Meijer Date: Fri, 16 Oct 2026 15:57:12 +0200 Subject: [PATCH] Postgres memory for the freed RAM: shared_buffers 8GB, effective_cache_size 32GB, random_page_cost 1.1, work_mem 16MB Co-Authored-By: Claude Opus 5.5 --- deploy/compose.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/deploy/compose.yaml b/deploy/compose.yaml index b01e561..32a23f3 100644 --- a/deploy/compose.yaml +++ b/deploy/compose.yaml @@ -46,19 +46,31 @@ services: # waited on it (WALWrite, 56–70 ms a write with the HDD 100% busy; LOG.md 2026-10-13 (43)). - ${PG_WAL_DIR:-/var/lib/usenet-rebuild-wal}:/var/lib/postgresql/wal # synchronous_commit = off is set with ALTER SYSTEM (postgresql.auto.conf in the data dir). + # Memory for 62 GiB of RAM shared with other services (LOG.md 2026-10-16 (69)): the catalog's hot part in + # shared_buffers, the planner told the OS caches the rest; random_page_cost for the NVMe (the HDD tablespace + # pg_default keeps 4: ALTER TABLESPACE … SET (random_page_cost = 4)). command: - postgres - -c - shared_preload_libraries=pg_stat_statements - -c - - shared_buffers=${PG_SHARED_BUFFERS:-2GB} + - shared_buffers=${PG_SHARED_BUFFERS:-8GB} + - -c + - effective_cache_size=${PG_EFFECTIVE_CACHE_SIZE:-32GB} + - -c + - random_page_cost=1.1 + - -c + - work_mem=16MB + - -c + - maintenance_work_mem=1GB - -c - max_wal_size=8GB - -c - checkpoint_timeout=15min - -c - wal_buffers=64MB - shm_size: 1g + # Parallel hash joins' shared memory: 1g failed with "could not resize shared memory segment" (LOG.md 2026-10-16 (61)). + shm_size: 2g stop_grace_period: 120s healthcheck: test: ['CMD-SHELL', 'pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"']