5mins of Postgres E25: Postgres lock monitoring, LWLocks and the log_lock_waits setting

Author: pganalyze
Published At: 2022-07-07T00:00:00
Length: 04:58

Summary

Description

Today, we are talking about Postgres locking. When it is concerning, what lightweight locks are, as well as the log_lock_waits setting in Postgres.

Find the article on our blog here: https://pganalyze.com/blog/5mins-postgres-lock-monitoring-lwlock-log-lock-waits

*Learn more about pganalyze:*

https://pganalyze.com

https://pganalyze.com/newsletter

https://twitter.com/pganalyze/

📑 What we have discussed in this episode of 5mins of Postgres:

- Postgres Locking: When is it Concerning? https://www.crunchydata.com/blog/postgres-locking-when-is-it-concerning

- David Christensen on Twitter https://twitter.com/pg_dwc

- pg_blocking_pids function https://www.postgresql.org/docs/current/functions-info.html#id-1.5.8.32.4.2.2.12.1.1.1

- Avoid PostgreSQL LWLock:buffer_content locks in Amazon Aurora: Tips and best practices https://aws.amazon.com/blogs/database/avoid-postgresql-lwlockbuffer_content-locks-in-amazon-aurora-tips-and-best-practices/

- Postgres Source Code Docs: Locking Overview https://github.com/postgres/postgres/blob/master/src/backend/storage/lmgr/README

- Simple test for lock_waits log messages https://gorthx.wordpress.com/2015/05/18/1068/

- gorthx on Twitter https://twitter.com/gorthx

- Postgres Log Monitoring 101: Deadlocks, Checkpoint Tuning & Blocked Queries https://pganalyze.com/blog/postgresql-log-monitoring-101-deadlocks-checkpoints-blocked-queries

- Log Insights: Lock Events - L71: Process still waiting for lock on tuple / relation / object https://pganalyze.com/docs/log-insights/locks/L71

- Log Insights: Lock Events - L70: Process acquired lock on tuple / relation / object https://pganalyze.com/docs/log-insights/locks/L70

- What is the performance cost of enabling "log_lock_waits" on Postgres? https://dba.stackexchange.com/questions/249901/what-is-the-performance-cost-of-enabling-log-lock-waits-on-postgres

Translated At: 2025-08-18T13:30:15Z

Request translate (One translation is about 5 minutes)

Version 3 (stable)

Optimized for a single speaker. Suitable for knowledge sharing or teaching videos.

Recommended Videos