Free Database Audit

Learn More
online/postgres 13-18/client-side only/0 bytes egress

postgres@jusdb:~$ jusdb tune --explain

PostgreSQL Config Optimizer

A workload-tuned postgresql.conf in seconds - RAM-budgeted shared_buffers + work_mem math, pooler-aware connection sizing, and a per-parameter rationale for every line it writes.

+OLTP / OLAP / Mixed / Web+memory footprint analysis+PgBouncer-aware+runs in your browser
shared_buffers
4GB
Max connections
300
work_mem
8MB
effective_cache
11GB

Server profile

Toggles max_connections sizing for backend pool vs direct app connections.

Memory footprint

16 GB budget
Realistic51%
Worst-case107%
shared_buffers
Maintenance (realistic)
Backends (~120 active)
OS reserve
Headroom / OS cache
shared_buffers4 GB
Maintenance (realistic)2 GB
Shared infra + bg130 MB
Backends (~120 active)2.1 GB
OS reserve2.3 GB
Headroom / OS cache5.5 GB

Bar shows realistic steady-state allocation: ~2 autovacuum workers active, ~40% of max_connections backends running with workload-typical work_mem ops. Worst-case pill (top-right) is the OOM ceiling - every backend peaks every buffer simultaneously, which essentially never happens but bounds the risk. PG keeps shared_buffers small (25%) so the headroom serves as OS page cache.

Disk footprint (beyond user data)

min_wal_size
512 MB
max_wal_size
4 GB
wal_keep_size
4 GB
WAL/day est.
4.9 GB-29.3 GB

WAL is the biggest disk consumer beyond user data. Provision your pg_wal volume for max_wal_size + wal_keep_size + 2× daily WAL so an unexpected slot pause doesn't fill the disk.

postgresql.conf
1# ─────────────────────────────────────────────────────────────────────
2# postgresql.conf — generated by JusDB PostgreSQL Config Optimizer
3# https://www.jusdb.com/tools/postgres-optimizer
4#
5# PostgreSQL version: 17
6# Role: Standalone (no replication)
7# Workload: OLTP (transactional, short queries)
8# Storage: NVMe SSD
9# Total RAM: 16384 MB
10# shared_buffers: 4096 MB (25% of RAM)
11# max_connections: 300 ceiling, ~120 realistic active
12#
13# Review every value before applying. These are conservative starting
14# points sized off your inputs — your workload's real shape (query mix,
15# index quality, write rate) will move the optimal values up or down.
16# ─────────────────────────────────────────────────────────────────────
17
18
19# ── Memory ──
20shared_buffers = 4GB
21effective_cache_size = 11GB
22work_mem = 8MB
23maintenance_work_mem = 1GB
24wal_buffers = 16MB
25
26# ── Connection handling ──
27max_connections = 300
28superuser_reserved_connections = 3
29listen_addresses = '*'
30
31# ── Write-ahead log (WAL) ──
32wal_level = replica
33min_wal_size = 512MB
34max_wal_size = 4GB
35
36# ── Checkpoints ──
37checkpoint_completion_target = 0.9
38checkpoint_timeout = 15min
39
40# ── Query planner ──
41random_page_cost = 1.1
42seq_page_cost = 1
43effective_io_concurrency = 200
44default_statistics_target = 100
45jit = off
46
47# ── Parallel query ──
48max_worker_processes = 12
49max_parallel_workers = 4
50max_parallel_workers_per_gather = 2
51max_parallel_maintenance_workers = 2
52
53# ── Autovacuum ──
54autovacuum = on
55autovacuum_max_workers = 3
56autovacuum_naptime = 30s
57autovacuum_vacuum_scale_factor = 0.05
58autovacuum_analyze_scale_factor = 0.02
59autovacuum_vacuum_cost_limit = 2000
60
61# ── Logging ──
62logging_collector = on
63log_directory = 'log'
64log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
65log_rotation_age = 1d
66log_rotation_size = 100MB
67log_min_duration_statement = 1000ms
68log_checkpoints = on
69log_connections = off
70log_disconnections = off
71log_lock_waits = on
72log_temp_files = 10MB
73log_autovacuum_min_duration = 1s
74log_line_prefix = '%m [%p] %q%u@%d '
75
76# ── Misc ──
77shared_preload_libraries = 'pg_stat_statements'
78track_io_timing = on
79track_activity_query_size = 4096
80idle_in_transaction_session_timeout = 60000
81statement_timeout = 0
82synchronous_commit = on
83password_encryption = scram-sha-256
84timezone = 'UTC'
85