• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved MySQL CPU usage

Dru

New Pleskian
Hi, recently the health monitoring on our server has started larting us to high MySQL CPU and Memory usage (it;s beeing getting over 20%).

Howveer when I check 'SHOW PROCESSLIST' there is almost always less than 10 process runnig and other than the admion 'Sleep' commands, ther eother have atime value of either 1 or 0 so I can't figure out whay the memoru and CPU usage is so high?

Is there something else I should be looking at?

This is based on the default Health Monitorin threshlds so CPU usage is currently around 25% - Should I worry, or just change the thresholds in the cusom-health-config.xml file?
 
Last edited:
The memory usage can increase dramatically when many "JOIN" commands create large Cartesian products of two or more tables. In that case, MySQL will reserve as much RAM as it is allowed by configuration /etc/my.cnf (and subsequent configuration files) and maybe create temporary files on disk for it. So it is possible that single processes instantly occupy a lot of RAM.

CPU usage does not sound too much.
 
  • Like
Reactions: Dru
@Dru

The latter part of this statement

This is based on the default Health Monitorin threshlds so CPU usage is currently around 25% - Should I worry, or just change the thresholds in the cusom-health-config.xml file?

is a good idea: do not worry, just increase the thresholds a bit. For instance, take something like 40%.

You will notice that you will not be bothered by notifications anymore.

And if you are, consider to use some (simple) performance tool like MySQLTuner.

Note that you should always be careful with changes in the config of MySQL server: one simple change can seem suitable, but can mess up the entire server.

Also verify that you get proper information when trying to find advice on MySQL performance tuning: make sure that you do not make typos in the config files and certainly do a thorough check of all directives being used (when using a deprecated directive, MySQL will simply not start in almost all cases).

Keep it simple, first start with the increase in the threshold for the Health Monitoring Extension (and the rest can always follow later).

Hope the above helps a bit.......

Kind regards.......
 
  • Like
Reactions: Dru
Ok, thanks guys, I have upped the threshold slightly in the Health Monitor as the percentages don't seem to be high compared to MySQL usage concerns in other threads but will continue to monitor for a some time. Certainly there a number of JOIN statmeents used in queires on this website so I'll keep an eye on them and see if they need re-strucuturing.
 
Back
Top