Postgres WAL on the NVMe; wal_buffers 64 MB
Every commit waited on the WAL in ./pg on the HDD (WALWrite; the HDD 100% busy, 56–70 ms a write): prober flushes and claims took most of each minute. A PG_WAL_DIR volume (default /var/lib/usenet-rebuild-wal) at /var/lib/postgresql/wal, with data/pg_wal a symlink to it (set up by hand once, with Postgres stopped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8e4ed774c0
commit
652f278474
2 files changed
+6
-1
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ homelab with the deploy key, whose forced command
|
|||||||
|
|
||||||
| Service | Image | Does |
|
| Service | Image | Does |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `postgres` | postgres:17 | the catalog (tablespace `nvme`) and the chunks (HDD) |
|
| `postgres` | postgres:17 | the catalog (tablespace `nvme`) and the WAL (`PG_WAL_DIR`, `data/pg_wal` a symlink to it) on the NVMe; the chunks (HDD) |
|
||||||
| `migrate` | `usenet-rebuild` (target `app`) | `migration:run`, before every deploy |
|
| `migrate` | `usenet-rebuild` (target `app`) | `migration:run`, before every deploy |
|
||||||
| `web` | `usenet-rebuild` | catalog API, Newznab, web interface; port 3334 (`HTTP_ROUTES=public`) |
|
| `web` | `usenet-rebuild` | catalog API, Newznab, web interface; port 3334 (`HTTP_ROUTES=public`) |
|
||||||
| `node-api` | `usenet-rebuild` | the edge workers' API (leases, streams, batches); port 3335 on the compose network only (`HTTP_ROUTES=node`) |
|
| `node-api` | `usenet-rebuild` | the edge workers' API (leases, streams, batches); port 3335 on the compose network only (`HTTP_ROUTES=node`) |
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ services:
|
|||||||
# nvme, the database's default_tablespace (LOG.md 2026-10-09 (14)).
|
# nvme, the database's default_tablespace (LOG.md 2026-10-09 (14)).
|
||||||
- ./pg:/var/lib/postgresql/data
|
- ./pg:/var/lib/postgresql/data
|
||||||
- ${PG_NVME_DIR:-/var/lib/usenet-rebuild-catalog}:/var/lib/postgresql/nvme
|
- ${PG_NVME_DIR:-/var/lib/usenet-rebuild-catalog}:/var/lib/postgresql/nvme
|
||||||
|
# The WAL on the NVMe too: data/pg_wal is a symlink to /var/lib/postgresql/wal. On the HDD every commit
|
||||||
|
# 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).
|
# synchronous_commit = off is set with ALTER SYSTEM (postgresql.auto.conf in the data dir).
|
||||||
command:
|
command:
|
||||||
- postgres
|
- postgres
|
||||||
@@ -53,6 +56,8 @@ services:
|
|||||||
- max_wal_size=8GB
|
- max_wal_size=8GB
|
||||||
- -c
|
- -c
|
||||||
- checkpoint_timeout=15min
|
- checkpoint_timeout=15min
|
||||||
|
- -c
|
||||||
|
- wal_buffers=64MB
|
||||||
shm_size: 1g
|
shm_size: 1g
|
||||||
stop_grace_period: 120s
|
stop_grace_period: 120s
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
Reference in new issue
Block a user