PostgreSQL Lock Tracer is a collection of tools designed to provide deep insights into PostgreSQL’s locking activities and help troubleshoot performance-related issues. It uses eBPF (extended Berkeley Packet Filter) technology to trace lock events of PostgreSQL processes in real-time with minimal overhead. It provides detailed information about lock acquisitions, wait times, and compiles statistics on the taken locks. Heavy locks, LWLocks, and row level locks are supported.
I wrote three blog posts about the project:
- Part 1: Trace PostgreSQL locks with pg_lock_tracer
- Part 2: Trace PostgreSQL LWLocks with pg_lw_lock_tracer
- Part 3: Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer