Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
Does the same happen if you reverse the test and run only the problem instance? –  Kyle Smith Feb 27 '12 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. –  Robert Feb 27 '12 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? –  Larry Silverman Feb 28 '12 at 18:41
    
Here are some other suggestions: stackoverflow.com/questions/1282232/mysql-high-cpu-usage –  Larry Silverman Feb 28 '12 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 –  Robert Feb 28 '12 at 19:26

2 Answers 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.

share|improve this answer
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.