pgconfigurator
pgconfigurator

deadlock_timeout

No restart — reload (superuser)time (ms)

How long to wait on a lock before checking whether a deadlock exists.

What it does

Deadlock detection is expensive, so PostgreSQL doesn't run it immediately — it waits deadlock_timeout (default 1 s) on a blocked lock, then checks for a cycle. It also doubles as the threshold for log_lock_waits.

How to tune it

Leave it near the default. Lowering it makes deadlocks resolve faster but runs the detector more often (overhead); raising it delays detection. If you mainly want it as the log_lock_waits threshold, tune it with that in mind.

Related parameters