Logging and monitoring

PostgreSQL instance with ‘log_lock_waits’ flag disabled

Risk Level

Informational (4)

Platform(s)
Compliance Frameworks

Description

The deadlock timeout defines the time to wait on a lock before checking for any conditions. Frequent run overs on deadlock timeout can be an indication of an underlying issue. Logging such waits on locks by enabling the log_lock_waits flag can be used to identify poor performance due to locking delays or if a specially-crafted SQL is attempting to starve resources through holding locks for excessive amounts of time.
  • Recommended Mitigation

    Add the following database flag: 'log_lock_waits=on'