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:

pglocktracer.png