侧边栏壁纸
  • 累计撰写 61 篇文章
  • 累计创建 35 个标签
  • 累计收到 4 条评论

目 录CONTENT

文章目录

【问题排查】Mysql占用CPU过高

李洪
2023-06-05 / 0 评论 / 0 点赞 / 522 阅读 / 129 字

【问题排查】Mysql占用CPU过高

1、查询mysql当前线程

show full processlist
# 或者
select id, user, host,db, command, time, state, info 
from information_schema.processlist
order by time desc;

2、time过长会导致CPU的占用

3、如果出现event_scheduler表示:mysql开启了事件调度功能,时间长了也会导致数据库CPU占用过高
image-1685956901880

4、关闭时间调度

set GLOBAL event_scheduler=OFF;

5、kill掉Time比较长的线程

kill 对应的id

https://www.51cto.com/article/703691.html

0

评论区