Schedule - PGDay Napoli 2025

Write Smarter, Not Harder: How PostgreSQL Can Use Bandwidth Better

Date: 2025-09-25
Time: 09:10–10:00
Room: Delle Colonne
Level: Intermediate

PostgreSQL is known for its reliability and extensibility—but under write-heavy workloads, performance can degrade in subtle and unexpected ways. In this session, I’ll share how I uncovered a surprising bottleneck in a high-throughput PostgreSQL system using pgbench and low-level OS metrics. While monitoring memory, CPU, disk I/O, and network utilization, I discovered that performance wasn’t limited by CPU or disk bandwidth, but rather by the number of disk IOPS—saturating around 3500 I/O operations per second due to small random writes. Despite available disk throughput, PostgreSQL couldn’t make full use of it because the underlying storage system was overwhelmed by high IOPS demand. To address this, I explored a strategy to merge small I/O requests into larger ones, thereby reducing pressure on the IOPS queue and making better use of available bandwidth. This led to experimenting with log-structured file systems, particularly F2FS, which naturally coalesce small writes and align well with PostgreSQL's write behavior. The result? A substantial increase in write TPS, with read performance remaining unaffected. In this talk, I’ll cover: • How to spot and diagnose IOPS bottlenecks in PostgreSQL • The performance impact of small write patterns • How LSM-style file systems like F2FS can improve write throughput • Benchmark results and lessons learned from real testing • When (and when not) to use this approach in production If you're an SRE, DBA, or performance-oriented developer working on large-scale PostgreSQL systems, this talk will equip you with new strategies to unlock performance where you least expect it: beneath the filesystem.

Speaker

Nikhil Chawla