本文共 488 字,大约阅读时间需要 1 分钟。
1.安装iotop,yum install iotop
2.iotop查看mysql进程里的各运行线程:iotop -u mysql ##-u mysql查询用户mysql运行的对应程序这边可以看到,虽然mysql是单进程实例,但是在运行过程中会产生很多线程。在某些卡顿的情况下,可以使用该命令查看哪个线程读写速率比较大3.结合iotop查看到的线程号,查询performance_schema中的threads表,看一下是哪个线程占用较大的io4.查看对应操作系统线程号与mysql哪个功能线程对应select name,type,thread_id,thread_os_id from threads;type字段中BACKGROUND表示后台线程,FOREGROUND表示前端线程,如连接线程等5.查看processlist_idselect name,thread_id,thread_os_id,processlist_id from threads; 对应show processlist查看当前连接:select connection_id()转载地址:http://zysel.baihongyu.com/