Memorydefault 128 MB

shared_buffers

Controls the size of PostgreSQL's shared buffer cache and influences cache hit rate, checkpoint behavior, and memory pressure.

Defaults and ranges on this page were read from pg_settings on live PostgreSQL 18.4.

What this means

Postgres doesn't hit the disk for every read, it keeps recently used table and index blocks in a shared patch of RAM, and shared_buffers sets how big that patch is. When the data you query most fits in there, it's served from memory instead of disk. The catch is that this memory is shared by the whole server, so making it huge on a small host starves everything else. The 128 MB default is deliberately conservative; on a dedicated database machine you raise it.

When it matters

Increase on dedicated database servers where PostgreSQL is expected to retain a meaningful working set in memory.

Default128 MB
Range16 – 2147483647
CategoryMemory
Check the current value
SHOW shared_buffers;

Tradeoffs

  • Too low: more read pressure on the OS page cache and disk.
  • Too high: can increase checkpoint cost and starve other memory consumers on small hosts.
  • Tuning should be paired with realistic checkpoint and WAL analysis.

Workload profiles

General OLTP

Start around 25% of RAM on a dedicated DB host.

Validate with cache hit ratio and checkpoint cadence.

Mixed app server + DB

Stay conservative and protect the OS plus application memory.

Shared host contention often matters more than theoretical cache size.

← All GUCs · Glossary · Runbooks