idle_in_transaction_session_timeout
No restart — settable per sessiontuned by pgconfiguratortime (ms); 0 disables
Terminates sessions left idle inside an open transaction.
What pgconfigurator would set
32 GB · 8 vCPU · NVMe · OLTP
Computing…
Tune for your exact server → /tunecomputed in your browser · nothing uploaded
What it does
A session that BEGINs a transaction and then sits idle holds locks and pins old row versions, blocking VACUUM and other writers. This setting aborts such sessions after the timeout, releasing what they held.
How to tune it
Set it (e.g. 30–60 s) to defend against buggy apps and forgotten transactions that cause bloat and lock pileups. Make sure it's longer than your legitimate transaction think-time so you don't kill real work mid-transaction.
FAQ
- Why is 'idle in transaction' bad?
- An open-but-idle transaction keeps its snapshot and locks, so VACUUM can't reclaim dead rows newer than it and other sessions may block. It's a top cause of mysterious bloat and lock waits — this timeout cleans up the offenders.