Capacity and configuration simulator
Compare a baseline with a proposed PostgreSQL setup. Edit assumptions to explore memory pressure, connections, disk growth and WAL retention. Everything runs in this browser.
Prepared export
Baseline → proposed
Memory budget
Concurrent sort/hash budgets are counted for each active query leader and available query worker. These are scenario budgets, not measured resident memory or a hard upper bound on PostgreSQL usage.
Storage projection
Relation files grow; WAL, temporary files, other files and rewrite allowances stay at the stated levels throughout the projection. Put only files from this same volume in the model. Separate tablespaces and WAL volumes need separate scenarios.
Proposed assumptions
The initial values are an illustrative 32 GiB host, not recommendations. Inputs remain local and are not stored after reload. Use a scenario export to save your work.
Import a scenario or captured settings
Load an exported scenario to restore both sides. Or apply a pg_settings capture to the proposed setup only. Captures replace listed settings; hardware, concurrency, base process memory, growth and disk allowances stay as entered. Review them after import.
Formulas, scope and PostgreSQL references
All sizes use binary units: GiB = 1,024 MiB. The model uses supplied values rather than release-specific defaults. Settings capture accepts PostgreSQL 14–19. OS/container limits, extensions, buffers beyond shared_buffers, temporary-table memory, logical decoding, additional backend memory and other services must be included in your allowances.
- Query participants = active client queries + min(requested parallel workers, max_parallel_workers, available max_worker_processes slots). One Gather per parallel query is assumed. Leaders count even when they mostly coordinate. Different plan shapes and shared Parallel Hash allocation can change actual use.
- Sort/hash budget in MiB = participants × work_mem × (simultaneous sorts + simultaneous hashes × hash_mem_multiplier). It assumes every listed operation uses its full budget at once. Multiple Gather nodes, other operations and unmodeled processes can exceed this scenario.
- Manual maintenance = concurrent commands × maintenance_work_mem. Its budget is per utility command, not multiplied by parallel utility workers. Autovacuum = concurrent workers × autovacuum_work_mem, using maintenance_work_mem when -1. Base autovacuum/maintenance process overhead belongs in other memory.
- Ordinary connection slots = max_connections − combined reserved slots. Open clients are assumed ordinary sessions; pools, role/database limits and worker scheduling are not simulated. Runnable participants / CPU cores is a concurrency indicator, not CPU utilization, TPS or latency.
- Daily relation growth: D(d) = D(0) × (1+r)^d + g × ((1+r)^d − 1) / r; for r = 0, D(d) = D(0) + g × d. Additions g occur at each day end; fractional-day runway interpolates this curve. Growth excludes WAL and the other fixed allowances.
- WAL space = max(operating budget, sustained WAL rate × longest slot lag OR archive outage). Retention on one primary overlaps across slots and archiving, so use the longest interval, not their sum. The same rate is assumed throughout. Add extra segment/checkpoint overhead to the other-files allowance, above this overlapping WAL estimate.
- max_wal_size is a soft checkpoint setting, not a disk cap. max_slot_wal_keep_size can invalidate a lagging slot at checkpoint; it does not safely bound total WAL space. The model does not clamp outage space to either setting. External archive estimate = WAL rate × 24 × retention days, excluding backups, compression, duplication and object-store overhead; it is not added to the primary volume.
- The reserve crossing is an arithmetic projection, not a disk-exhaustion prediction. Bloat, reclaim, rewrites, bursts, archive failures and changing workloads need measurements. No SQL settings changes, restart scripts or automatic tuning are produced.
Memory and parallel workers · Connection slots · WAL and checkpoints · WAL retention