编程知识 cdmana.com

Data connection timeout setting of MySQL

Large scale multithreading operations on transactions , Sometimes open a link , Will wait , At this time, if the database timeout is set too short , It could happen , Data links are automatically released , Of course, it's not good to set it too big , slow SQL Or other factors cause the link to be too long , Causing the whole system to slow down , Even hung up .

SO, Set the timeout appropriately .

I checked a lot of information on the Internet , Most solutions are written too complex , In fact, as long as you set the waiting timeout OK 了

problem :mq Consumption time mysql From time to time mysql gone away

terms of settlement : Because this is the function of payment So set the waiting time 12 Hours , Avoid disconnection when you don't pay at night .

Setup method :

SHOW GLOBAL VARIABLES LIKE '%timeout%'
SET GLOBAL wait_timeout=43200

版权声明
本文为[Li Jiashun]所创,转载请带上原文链接,感谢

Scroll to Top