high usage mysql + just for one user

morteza3245

Well-Known Member
Sep 16, 2013
154
1
68
cPanel Access Level
Root Administrator
Hello
i see my mysql have much usage:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
306175 mysql 20 0 10.9g 3.4g 1.2g S 161.2 7.2 1606:46 mysqld
when i did run "mysqladmin processlist;" i saw one user have much process:
| 418833 | par****a_ha****2 | localhost | par****a_ha****2 | Sleep | 0 | | |
| 418835 | par****a_ha****2 | localhost | par****a_ha****2 | Query | 1 | Sending data | SELECT COUNT(*) FROM td5ia_k2_comments WHERE itemID=28 AND published=1 |
| 418839 | par****a_ha****2 | localhost | par****a_ha****2 | Query | 0 | Sending data | SELECT COUNT(*) FROM td5ia_k2_comments WHERE itemID=23 AND published=1 |
| 418841 | par****a_ha****2 | localhost | par****a_ha****2 | Query | 0 | Sending data | SELECT COUNT(*) FROM td5ia_k2_comments WHERE itemID=22 AND published=1
| 418845 | par****a_ha****2 | localhost | par****a_ha****2 | Sleep | 0 | | |
also in dbtop command i see:

User .cpu(%) * . read(B/s) . write(B/s) . CAUSE
pa***a 231/301/240 0/0/0 97974/84513/76185-
they are for one user.

how i can see why have this usage? or how i can resolve that?

Thanks!
 
Last edited:

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
Indiana, USA
Unless you manage the script the user is using and you wrote the MySQL queries they're executing there's very likely little you can do short of perhaps making sure your MySQL is optimized for your environment. You'd probably want to get in contact with the customer and advise them of their usage and ask them to optimize - if they can't do it, there's not really any way you could do it unless you want to update/manage their script for them.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello :)

It's really not a good idea to attempt to kill database processes as a method for reducing usage. Instead, you may want to consider suspending the account and restarting MySQL if you want to ensure it's disabled. The following thread is useful for obtaining information on tuning your MySQL:

mysqlmymonlite.sh server stats gathering tool for cPanel Server

Thank you.