5

MySQL is eating up about 80% of my CPU for no reason as far as I can see. Right now this server is rarely used, more of a test site I set up that will eventually be a used for production once I fix small problems like this. I run 3 instances of MySQL but it seems that my first instance is taking up all the CPU. When I turn off the first instance and leave the other two on everything runs fine.

Any suggestions?

I tried Show Processlist and no statements are being run besides "Sleep" and the query "Show Processlist" (obviously) at the time it's using up all this CPU.

my.cnf is basic. I did not optimize or change any MySQL settings. Do you think this would cause such strange behavior?

The machine is running Linux Centos 5.7 64 bit and MySQL 5.0.95.

Thanks

6
  • Does the same happen if you reverse the test and run only the problem instance? Commented Feb 27, 2012 at 20:26
  • yes if that is the only one running still eats up alot of the CPU. If I shut down the instance and turn it back on for about 1-2 minutes its fine and then after that grace period it starts to eat up the CPU again. Commented Feb 27, 2012 at 20:43
  • Is this a dedicated server or a virtual machine? Private or shared? What ports are the mysql processes running on? Is the server "exposed" on the internet; on a test network, isolated from other machines; or something in-between? Commented Feb 28, 2012 at 18:41
  • Here are some other suggestions: stackoverflow.com/questions/1282232/mysql-high-cpu-usage Commented Feb 28, 2012 at 18:44
  • Virtual Machine, Private?, 3306,3307,3308 and its on internet but access is restricted to only me right now but in the future for only other employees. This server to to be run on our local network so 95% of traffic will be local Commented Feb 28, 2012 at 19:26

2 Answers 2

2

Make sure you use an account with administrator permissions when you check for running queries on MySQL. Typically you'll only see your own queries. If some other system process is toying around in the background on MySQL, it might not be obvious.

Consider also atop to see related disk activity and innotop.

0

After Fine tunning mySQL I was able to get the CPU down from running at 90% to about 35%. It's idling so high becuase of the select statements that are used for replication into a sybase server.

Programs I used for tunning

mySQLtuner 1.2.0 by Major Hayden

AND

mySQL Performance Tuning Primer By Matther Montgomery.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.