السي بانال WHM/CPanel حل مشكلة MySQLCPU 90% ومعرفة قاعدة البيانات المستهلك

High CPU usage from mysql process - High MySQL CPU usage
MYSQL : High CPU Usage 200% - MySQL CPU usage 100%
Mysqld - high CPU usage -MySQL Extremely High CPU Usage 300%




المشكلة :

تجد ان هناك ارتفاع فى استهلاك CPU بسبب mysql بنسبة مرتفعه تصل الى 100 % واكثر احيانا
لكن لا يظهر لك ما هو العميل او قاعدة البيانات المسببة لذلك.

حل المشكلة :

During one of the times you see the slowness with MySQL
Home / SQL Services / Show MySQL® Processes



او من خلال هذا الامر

كود:
mysqladmin proc status
as this will show you the user running the command, how long it has been running, the database, and the query. It will also give you a summary of what MySQL doing, including how many queries per second are being run and how many open tables there are, which can help you identify if MySQL is reaching any limits.

Seeing one process using high resources doesn't necessarily mean there is an issue. If that only happens every so often it could just mean there is a CPU intensive query that is being run that uses a large amount of CPU. If you see the high usage again, running the mysqladmin proc status command may show you exactly what is happening.

It's best to let the system run a bit longer as the mysqltuner tool will tell you, as your output did, that the MySQL service wasn't online for at least 24 hours, so the data and recommendations may not be complete enough for the tuner script to get a full picture of your server's situation.



كما يمكنك استخدام هذا الكود للمزيد من التفاصيل

كود:
mysqladmin pr|awk -F "|" '{ print $3 }'|grep _|sort|uniq -c|sort -n
حل اخر لمشكلة ارتفاع اللود بسبب قواعد البيانات mysql

ثبت mysql governor اذا كنت كلاود لينكس

MySQL Governor tracks CPU and disk IO usage for every user in real time and throttles MySQL queries by using LVE limits. By using the dbtop utility, it is possible to see the database usage on a per-customer basis, ensuring that the system admin always know what is going on.

dbtop
monitors MySQL usage on per user bases.
Utility to monitor MySQL usage. Requires db_governor to be running. It shows usage for the current, mid and long intervals.

ادخل امر لاعطاء استهلاك قاعدة البيانات فى لحظتها ثانية ثانية

كود:
dbtop
او ادخل هذا الامر ليعطى تقرير حالى
show one time user list (no interactive mode)

كود:
dbtop -c

المرجع:
https://forums.cpanel.net/threads/hi...rocess.700121/
https://dev.mysql.com/doc/refman/8.0/en/memory-use.html
https://forums.cpanel.net/threads/my...-usage.374152/
https://forums.cpanel.net/threads/my...ge-100.656871/
https://forums.cpanel.net/threads/my...-usage.536301/
https://forums.cpanel.net/threads/hi...rocess.672933/
https://forums.cpanel.net/threads/ve...-usage.277811/
https://forums.cpanel.net/threads/my...o-high.405081/
https://forums.cpanel.net/threads/hi...nobody.700689/
-------
https://docs.cloudlinux.com/introduction/
https://docs.cloudlinux.com/shared/c...LjAuMA..#dbtop