Fast path lock exhaustion causes lock manager contention during read operations
warningResource ContentionUpdated Jul 30, 2025
Technologies:
How to detect:
When backend processes exceed 16 unique table/index locks (FP_LOCK_SLOTS_PER_BACKEND limit), PostgreSQL migrates from fast path locking to shared memory lock hash table, triggering LWLock:LockManager contention. This occurs even during read-only operations when accessing tables with many partitions or indexes.
Recommended action:
Monitor pg_locks view to check if fastpath column shows 'f' (false) for locks, indicating fast path slot exhaustion. Query active sessions for LWLock:lock_manager wait events in CloudWatch Database Insights or pg_stat_activity. Reduce locks per transaction by using partition pruning, removing unused indexes, or simplifying join patterns to stay within 16-slot limit.