• 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

mysqld

M

met00

Guest
CPU GenuineIntel, Intel(R) Pentium(R) 4 CPU 3.00GHz
Version psa v7.5.4_build75060617.18 os_FedoraCore 3
OS Linux 2.6.11.9-050512a

###

mysqld seems to run away with all the CPU. starts out taking chunks at 20%-30% for 3-5 refreshes of "top", then drops out for 2-3 refreshes, then bounces back up. Server is running very few active processes (httpd's) as it's 3 in the morning.

This is AFTER we saw it at 99% (uptime was 63 days) and it was at 99% of the CPU and not dropping, ever.

any suggestions on where to even start looking for why mysqld seems to run away and eat up massive amounts of CPU. Thanks in advance.
 
You may want to watch threads_created status variable. If there is a lot of threads being created and/or destroyed then you will find mysql is spending a high % of sys CPU time.

mysqladmin extended-status |grep -i threads_created/quote]

If it is creating and destroying alot of threads then you should tune the thread_cache_size variable in /etc/my.cnf:

set-variable = thread_cache_size=32

If it is user CPU time, then you may want to take a look at the slow queries. You can enable logging of slow queries by tweaking /etc/my.cnf:

set-variable = long_query_time=4
log-slow-queries=/var/lib/mysql/slow.log

You may want to take a peek at mytop and mysqlreport:

mytop
mysqlreport

They are both good tools for tuning mysql.
 
Back
Top