Analyzing Postgres performance problems using perf and eBPF
summary
Uses perf to find kernel-side hotspots (high CPU in TLS/crypto locks) and shows that upgrading OpenSSL 1.0.2 → 1.1 raises pgbench throughput ~4x and halves CPU. Demonstrates bpftrace scripts that count OS page-cache misses and bytes per Postgres PID, attach lwlock wait stacks, and augment pg_stat_statements with kernel-level I/O and network-send metrics. Notes tracing cost is probe-frequency dependent; lwlock probes add negligible overhead when already blocked.
AI-written summary · about
chapters (5)
- 0:00Introduction
- 1:48Perf—a Linux kernel profiling tool
- 12:48bpftrace
- 23:08pg_stat_statements + BPF
- 25:32Q&A with Andres & Marco
related talks
56mPostgreSQL at low Level: stay curious!
31mDemanding the impossible rigorous database benchm
53mVisualizing Postgres I O Performance for Development
56mPerformance Improvements in PostgreSQL9 2
50mPerformance Archaeology
27mDebugging Linux Issues with eBPF
36mAutomated Performance Testing of Postgres
30mPostgreSQL and Linux Kernel interactions
