1s
is reasonable for most OLTP workloads. For systems with high contention or long-running transactions, consider increasing to 2-3s
. For highly concurrent systems with frequent deadlocks, you might reduce to 500ms
. Monitor deadlock frequency and adjust accordingly.max_locks_per_transaction * (max_connections + max_prepared_transactions)
.64
is sufficient for most applications. Increase to 128
or 256
for applications that access many tables in single transactions (e.g., ORMs with complex queries or partitioning setups). Monitor lock usage and increase only when necessary to avoid memory waste.2
is generally appropriate. Increase to 4-8
for workloads with very focused updates on specific pages where page-level locking would be too restrictive. Lower values conserve memory but may cause more false-positive serialization failures.32
works for most scenarios. For large tables with widespread access patterns, consider increasing to 64-128
. For very large systems using serializable isolation, monitor predicate lock usage and adjust accordingly to balance memory usage and concurrency.max_pred_locks_per_transaction * (max_connections + max_prepared_transactions)
. Insufficient capacity can cause serialization failures even when no actual conflicts exist.64
is sufficient for most applications not using serializable isolation. For serializable isolation workloads, increase to 128-256
based on transaction complexity. Monitor predicate lock usage and adjust gradually, as excessive values can consume significant shared memory.Start your journey toward a healthier PostgreSQL with pghealth.
You can explore all features immediately with a free trial β no installation required.
π Start Free Trial