← Back to blog

PostgreSQL capacity planner

PostgreSQL tuning that respects concurrency

More than presets: model work_mem under load, WAL, I/O, parallelism, and the point where pooling becomes mandatory.

1. Real infrastructure

Use the container/VM memory limit.

2. Concurrency, not sockets

work_mem is sized against active queries.

3. Review before applying

Compare with pg_settings and EXPLAIN.

Version, environment, and workload

Capacity and concurrency

These values control the model and do not replace observation of real metrics.

Tuning catalog

Parameter-by-parameter recommendations

The advisor covers every high-impact GUC group. Topology settings such as slots and senders must be confirmed against the real architecture before application.

work_mem

It is the riskiest setting to raise without modeling operations and concurrency. Do not equate max_connections with concurrent heavy queries.

WAL & checkpoints

More WAL reduces checkpoint pressure, but needs disk capacity and RPO awareness. The plan adjusts its starting point by RAM and write intensity.

I/O & planner

effective_cache_size does not reserve memory. It informs the planner about expected cache. random_page_cost and effective_io_concurrency must reflect real storage.

From calculation to real operations

A calculator shows the risk. PG Monitoring shows when it is happening.

Use this plan as a starting point. Then connect PostgreSQL to validate configuration against real load, concurrency, I/O, WAL, autovacuum, and query behavior — continuously, not only on tuning day.

Assisted diagnostic: we never request passwords or connection strings through forms, email, or WhatsApp.

What the SaaS tracks in PostgreSQL

  • Memory, connections, waits, I/O, and real-time health
  • Slow queries, plans, temporary files, and regressions
  • Autovacuum, bloat, locks, replication, and operational risk
  • Configuration recommendations with workload context
  • Alerts and history to prove whether a change improved things

Frequently asked questions

Is work_mem per connection?+

No. work_mem is a limit per sort or hash operation, and one query can use multiple operations, parallel workers, and concurrent sessions at once.

Does effective_cache_size allocate memory?+

No. It is a planner estimate of cache available in PostgreSQL and the operating system.

Why not simply raise max_connections?+

Many connections increase memory use and contention. For large client populations, PgBouncer is usually safer than raising max_connections.

Should shared_buffers use all RAM?+

No. PostgreSQL relies on operating-system page cache. On dedicated hosts, 25% is a common starting point and values above 40% are rarely the best initial choice.

Based on the official PostgreSQL resource-consumption documentation. Suggestions are starting points: validate with pg_settings, pg_stat_database, pg_stat_statements, EXPLAIN (ANALYZE, BUFFERS), and host metrics.

Talk to us