المساعد الشخصي الرقمي

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



Rise Company
18-10-2022, 14:10
السي بانال 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%


https://www.rise.company/upload/uploads/166609520658551.png

المشكلة :

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

حل المشكلة :

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

https://www.rise.company/upload/uploads/166609687821731.png

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


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.

https://www.rise.company/upload/uploads/166609713739561.png

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


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 (https://docs.cloudlinux.com/command-line_tools/#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/high-cpu-usage-from-mysql-process.700121/
https://dev.mysql.com/doc/refman/8.0/en/memory-use.html
https://forums.cpanel.net/threads/mysql-high-cpu-usage.374152/
https://forums.cpanel.net/threads/mysql-cpu-usage-100.656871/
https://forums.cpanel.net/threads/mysql-extremely-high-cpu-usage.536301/
https://forums.cpanel.net/threads/high-cpu-usage-due-to-mysql-process.672933/
https://forums.cpanel.net/threads/very-high-mysql-cpu-usage.277811/
https://forums.cpanel.net/threads/mysql-cpu-usage-too-high.405081/
https://forums.cpanel.net/threads/high-cpu-load-mysql-and-nobody.700689/
-------
https://docs.cloudlinux.com/introduction/
https://docs.cloudlinux.com/shared/command-line_tools/?_gl=1*19i2szl*_up*MQ..*_ga*MTk2ODM3NjIwNy4xNzA1Mz Y3Mjcw*_ga_1RCQ134PYC*MTcwNTM2NzI2Ny4xLjAuMTcwNTM2 NzI2Ny4wLjAuMA..*_ga_V4QHJSZM47*MTcwNTM2NzI2Ny4xLj AuMTcwNTM2NzI2Ny4wLjAuMA..*_ga_8LBSSX7VQX*MTcwNTM2 NzI2Ny4xLjAuMTcwNTM2NzI2Ny4wLjAuMA..#dbtop