PostgreSQL参数学习:deadlock_timeout

磨砺技术珠矶,践行数据之道,追求卓越价值
回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页
[作者 高健@博客园  [email protected]]

 

此参数是说:在等待一个lock被释放的时间里,多久可以启动deadlock检查机制。

deadlock检查机制执行的代价比较高,因此在符合较重、locK动作较多的系统里,可以适当地增大 deadlock_timeout。

http://www.postgresql.org/docs/9.2/static/runtime-config-locks.html

 

This is the amount of time, in milliseconds, to wait on a lock before checking to see if there is a deadlock condition. The check for deadlock is relatively expensive, so the server doesn't run it every time it waits for a lock. We optimistically assume that deadlocks are not common in production applications and just wait on the lock for a while before checking for a deadlock. Increasing this value reduces the amount of time wasted in needless deadlock checks, but slows down reporting of real deadlock errors. The default is one second (1s), which is probably about the smallest value you would want in practice. On a heavily loaded server you might want to raise it. Ideally the setting should exceed your typical transaction time, so as to improve the odds that a lock will be released before the waiter decides to check for deadlock. Only superusers can change this setting.

When log_lock_waits is set, this parameter also determines the length of time to wait before a log message is issued about the lock wait. If you are trying to investigate locking delays you might want to set a shorter than normal deadlock_timeout.

  

[作者 高健@博客园  [email protected]
回到上一级页面: PostgreSQL基础知识与基本操作索引页     回到顶级页面:PostgreSQL索引页 
磨砺技术珠矶,践行数据之道,追求卓越价值 

你可能感兴趣的:(PostgreSQL)