Home > Database > Mysql Tutorial > body text

禁止死锁检测来提升高并发MySQL性能_MySQL

WBOY
Release: 2016-06-01 13:44:20
Original
980 people have browsed it

bitsCN.com

 

在一个高并发的MySQL服务器上,事务会递归检测死锁,当超过一定的深度时,性能的下降会变的不可接受。FACEBOOK早就提出了禁止死锁检测。

我们做了一个实验,在禁止死锁检测后,TPS得到了极大的提升,如下图所示:

/

 

禁止死锁检测后,即使死锁发生,也不会回滚事务,而是全部等待到超时

Patch比较简单,直接在死锁检测前加一层判断即可:

if (innobase_deadlock_check && UNIV_UNLIKELY(lock_deadlock_occurs(lock, trx))) 

。。。。

innobase_deadlock_check是在innodb里新加的系统变量,用于控制是否打开死锁检测

 

摘自 zhaiwx1987

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!