Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a Java based SaaS application running on MySQL database on a 2 GB Linux VPS.

Recently we added RAM to the server and since couple of days, MySQL is taking up 99% of CPU usage. We are quite clueless as to why this is happening.

We have made some changes in the my.cnf file as we have read in certain forums. We have enhanced the resources for MySQL.

Where can we go next?

share|improve this question

migrated from Oct 7 '10 at 12:39

This question came from our site for professional and enthusiast programmers.

Most probably you have plenty of 'expensive' queries - like full table scans. Data probably fits in memory but cpu is busy crunching its content. Try suggested slow query logging and use explain command to understand what exactly mysql is doing with those queries.

check this presentation. Try following log analysis tools:

share|improve this answer
mysqltuner ( is worth a mention too. – symcbean Oct 7 '10 at 14:51

You can enable the MySQL Slow Query Log to see if you have any exhausting queries running on the server, by default this will log any query that takes longer than 1 sekond to execute.

Also the MySQL profiler ought to be useful to determine what is causing the heavy load on the server.

share|improve this answer

Your Answer


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