Journey of developing a Performance Optimization Feature in PostgreSQL
summary
Describes implementing a PostgreSQL change that lets the WAL sender transmit unflushed WAL pages to standbys by adding a flush pointer added to the replication protocol, measured with perf and flame graphs and pgbench. Benchmarks (custom scripts, 40 KB vs 8 MB transaction tests) raise TPS from ~125 to 133 and reduce WAL read I/O; perf shows send cost rising from ~18.5% to ~43.5% in extreme cases. Work is WIP because standby-side changes (WAL buffers, spill files, or pause signaling) are needed to avoid extra disk writes.
AI-written summary · about
chapters (9)
- 0:00Introduction and talk overview
- 2:16Physical replication basics
- 9:13WAL buffers and fsync explained
- 12:03Identifying replication bottlenecks
- 18:33Profiling with perf and flame graphs
- 23:05Optimizing WAL sender with unflushed data
- 26:42Benchmarking the optimization
- 30:54WAL receiver challenges and solutions
- 39:16Summary and future work
related talks
33mJourney of developing a performance optimization feature in PGSQL
31mPostgreSQL WAL and Commit Synchronization, Optimization Opportunities
24mPostgreSQL physical replication - internals, latest development and opportunities
35mUnderstanding and Optimizing commit sychronization for maximum performance
57mDurability in Postgres
53mVisualizing Postgres I O Performance for Development
56mPerformance Improvements in PostgreSQL9 2
31mOptimizing Postgres for write heavy workloads ft. Checkpoint and WAL configs
