It seems to me like there's always 1 task in SQL that runs on my server at work and my personal stuff that gets "stuck" and keeps running forever.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
890 mysql 20 0 326m 54m 7704 S 9999 1.4 13:05.03 mysqld
Is there a way that I can setup a bot to find stuff like this, shut it down and restart MySQL so I don't need to do it manually ?
update
I should point out that it doesn't always stay at 9999% CPU. Sometimes it shows 1.4 or something like that