Mysql Monitor High Cpu Usage in Realtime

Feb 24, 2021
SHOW FULL PROCESSLIST\G
*************************** 1. row ***************************
      Id: 650
    User: web
    Host: localhost:37462
      db: bot_monitor
 Command: Query
    Time: 18827
   State: Sending data
    Info: SELECT p1.*
FROM notification p1 LEFT JOIN notification p2
  ON (p1.bot_id = p2.bot_id AND p1.created < p2.created)
WHERE p2.bot_id IS NULL
Progress: 0.000
*************************** 2. row ***************************
      Id: 676
    User: web
    Host: localhost:37570
      db: bot_monitor
 Command: Query
    Time: 18527
   State: Sending data
    Info: SELECT p1.*
FROM notification p1 LEFT JOIN notification p2
  ON (p1.bot_id = p2.bot_id AND p1.created < p2.created)
WHERE p2.bot_id IS NULL
Progress: 0.000

Time indicate how long the query/process had been running.

You can kill a process via Id

KILL 650

Or kill all process by a user

KILL USER web;

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.