Mysql running at 100% randomly
A mysql restart restores it fine but it keeps happening and I'm not sure why.
Which error logs are best to check on this , I tried var/log/mysql.log but theres nothing in it.
Thanks for any help
10 Replies
Thanks
I have Livezilla on it so can see who's coming in or out and only running one site and traffic has been probably even lower than normal (has been since Googles mayday changes).
(*That is, a few dozen thousand full scans on a ~100MB table… unfortunately, each took less than 2 sec, so no slow log entries.)
It does not indicate the issue as such so I am wondering if the last comment is more relevant as it is an issue where all the databse connections are being used for some reason, I will check that next.
high CPU is a sign of excessive forking.
For a Linode 768 I have:
Threads:
thread_concurrency = 4
threadcachesize = 6
> high CPU is a sign of excessive forking.
Erm, what?
> thread_concurrency = 4
Interesting…
> This variable is specific to Solaris systems, for which mysqld invokes the thr_setconcurrency() with the variable value. This function enables applications to give the threads system a hint about the desired number of threads that should be run at the same time.
MySQL runs a thread per connection, unless you enable the single thread mode, which's extremely inefficient and used only for debug purposes.
@brfsa:
high CPU is a sign of excessive forking.
There's quite a few more likely things, depending on what "high CPU" really means.
@jed:
@brfsa:high CPU is a sign of excessive forking.
There's quite a few more likely things, depending on what "high CPU" really means.
TRUE, CPU usage is divided in 3 categories: user, system, iowait.
I had experience that mysql was taking on all IOwait, after an extensive mysql profiling we had to tune my.cnf to match the work load (joins, query cache, threads cache, sort_buffer etc)
have a look at the mysql sample config files under /usr/share/doc/mysql-x.x.xx/support-files/ {my-medium.cnf my-large.cnf my-huge.cnf}
Some tools you can use to find out your CPU usage are mpstat (found on sysstat package) and iostat
also: