ALL
One Way to Quickly Locate SQL with High CPU Usage in MySQL
When the CPU usage of a MySQL database rises abnormally, it's necessary to quickly identify the problematic SQL statements. In this post, we try to provide one way to achieve this. Below are the actual steps.1. Use the top command to find the threads with the highest CPU usage in the MySQL process.# Find the MySQL process IDps -ef | grep mysql# Use the process ID to find the thread IDs with the highest CPU usage:top -H -p In top, press P to sort by CPU usage.Note the thread ID, for example, 39449.2. Log in to the database to query performance_schema and information_schema.-- Query the thr...
1,429 0 MYSQL DEBUG HIGH CPU SLOW QUERY