Como va
In order to identify the clients that are causing the excessive CPU consumption, I would recommend taking a few basic steps to monitor the MariaDB server and determine the root causes of the excessive usage.
First, you will need to acquire and install a server monitoring tool. Popular monitoring tools for MySQL and MariaDB databases include tools such as NewRelic, SolarWinds, and Percona Monitoring and Management (PMM). These are all excellent tools which will enable you to quickly and easily identify the MySQL processes on your server that are consuming the highest amount of CPU.
Once you have identified the processes consuming the most CPU, you can then use an automated query analyzer to determine which queries are being executed and which users are executing them. The Percona Toolkit includes a performance/query analysis tool, pt-query-digest, that can provide a detailed report on the queries being executed and the users that executed them. You can also use the MySQL slow query log to identify the queries that are taking the longest to run and determine which users are running them.
Finally, you can use a tool such as the MySQL User Statistics Plugin to collect detailed information on which users are executing the most queries and consuming the highest amount of CPU. With this level of information, you can easily pinpoint which user or users are responsible for the excessive CPU consumption and make the necessary changes to optimize their queries and reduce the CPU load.
With the help of these tools, I am confident that you will be able to successfully identify the clients that are consuming the highest amount of CPU and take the necessary actions to optimize their queries and reduce the load on the MariaDB server. Please let me know if you need any further assistance with this project.
Best regards,
Giáp Văn Hưng