mysqld 进程CUP占用过高

一、运营 top 查看服务器mysqld  PID  7279

mysqld 进程CUP占用过高_第1张图片

 二、top -H p 7279 查看占用高的PID 是 14797

mysqld 进程CUP占用过高_第2张图片

 三、mysql中查询当前PID 执行的SQL

SELECT
	a.USER,
	a.HOST,
	a.db,
	b.thread_os_id,
	b.thread_id,
	a.id processlist_id,
	a.command,
	a.time,
	a.state,
	a.info 
FROM
	information_schema.PROCESSLIST a,
	PERFORMANCE_SCHEMA.threads b 
WHERE
	a.id = b.processlist_id 
	AND b.thread_os_id = 7332;
SELECT
	* 
FROM
	PERFORMANCE_SCHEMA.events_statements_current 
WHERE
	thread_id = ( SELECT thread_id FROM PERFORMANCE_SCHEMA.threads WHERE thread_os_id = 524336 );

你可能感兴趣的:(服务器,linux,运维)