Blogger Information
Blog 20
fans 1
comment 1
visits 30505
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
mysql出现很多sleep状态出力方法
大瓶可乐
Original
2169 people have browsed it

当我们使用 SHOW PROCESSLIST 查看mysql进程列表的时候会发现很多SLEEP状态

如图

CA1E94F3-3785-4a1f-B8EE-720FDDA7EF1E.png

我们可以设置一个超时配置

sql命令:

SHOW GLOBAL VARIABLES LIKE 'wait_timeout'; //先查看配置

SHOW GLOBAL VARIABLES LIKE 'interactive_timeout'; //先查看配置

set global wait_timeout=30; //设置为30秒

SET GLOBAL interactive_timeout=30; //设置为30秒

但是重启mysql后就会失效,所以建议直接修改mysql配置文件


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post