Advanced11 min read
Host a PostgreSQL database on a high-memory plan
Sizing, the settings worth changing, and a restore you have actually tested.
Last updated 1 August 2026
The goal is simple: keep the working set in memory and keep enough free disk for the write-ahead log to grow between checkpoints.
Settings worth changing
| Setting | Value | Why |
|---|---|---|
| shared_buffers | 8GB | Roughly a quarter of memory. |
| effective_cache_size | 24GB | A hint about what the kernel caches. |
| work_mem | 32MB | Per sort or hash node, so raise it carefully. |
| maintenance_work_mem | 2GB | Speeds up VACUUM and index builds. |
Backups
bash
pg_dump --format=custom --file=/var/backups/app.dump appA backup you have not restored is a guess
Restore into a scratch database at least once, and time it. That number is your recovery objective, whatever your notes say.Was this page useful?
Feedback about article postgres-high-memory