Read replica cache and IOPS sizing

A read-heavy replica handles 12,000 queries per second, each touching three pages. It often reaches 98% cache hits, while a hot share of 45% must compete for 16 GiB of RAM.

Jump to results

Inputs

Table and indexes
bytes
bytes
%
%
bytes
%
Growth and cache
months
%
GB
Disk and WAL workload
queries/s
queries/s
%
bytes

Results

Runs in your browser
Heap and indexes now
52.8GB
12-month storage
112.2GB
36-month storage
118.8GB

The modeled hot working set exceeds available RAM.

Table and index growth
Table and index growthHeap and indexes now 52.8 GB. 12-month storage 112.2 GB. 36-month storage 118.8 GB0 GB59.4 GB118.8 GBNow12 mo36 moHeap + indexesHeap alone
Detailed results
Current heap44 GB
Current indexes8.8 GB
12-month rows170,000,000
36-month rows180,000,000
Hot working set23.76 GB
Working set / available RAM138.301 %
Read IOPS720 IOPS
Write IOPS100 IOPS
Data page I/O820 IOPS
WAL write throughput0.09 MB/s
Data and WAL throughput6.807 MB/s
WAL generated per day7.776 GB

What to try

Compare the hot working set against available RAM, then reduce the hit rate to model a cold replica. The 98% case should not be the sole disk performance target.

How the estimate works

Heap bytes ≈ rows × (payload + tuple overhead) ÷ fillfactor × (1 + bloat)

The heap estimate includes row overhead, free space from fillfactor, and extra bloat. Index size uses an average entry size, a B-tree overhead factor, and the same bloat factor. Use measured relation sizes to calibrate these estimates when available.

A forecast month is 30 days. When a retention period and a positive arrival rate are set, future rows are capped at arrivals within that retention horizon. The current size uses the supplied row count. Forecast points assume pruning is effective by that point.

Read IOPS comes from uncached page touches. Page I/O assumes 8 KiB pages and a steady write rate. WAL bandwidth uses bytes generated per write. Data page throughput and WAL throughput are added. A WAL segment retention policy, TOAST, maintenance spikes, and replica amplification need separate sizing.

Frequently asked questions

Why can a replica with 98% hits still need 720 read IOPS?

Two percent of 36,000 page touches each second miss the cache in this model. A high hit fraction can still leave a large absolute miss rate.

Which writes should I count when sizing a PostgreSQL read replica?

Use measured page-write activity from replay and background work. A read-only client endpoint can still have substantial storage writes.

Open Database storage & IOPS calculator