Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have one MySQL process on my server running linux and it's always running it takes at least 50% usage of 1 Core (I have 8 cores)... This is process command:

/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ --pid-file=/var/lib/mysql/

What this process is doing? This is not the issue just a question.

share|improve this question

closed as not a real question by John Gardeniers, Michael Hampton, rnxrx, voretaq7 Nov 29 '12 at 21:16

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I want to reduce my CPU usage as far I can, that is the reason why I am asking this :) – Luka Nov 28 '12 at 23:25
You need to narrow the scope of what you're asking substantially. If you have a problem, state it, along with any error messages you have received, research you've done, and steps you've taken to remedy the problem which haven't worked. See this meta question for more help on formulating a good, answerable question... – voretaq7 Nov 29 '12 at 21:17
up vote 3 down vote accepted

You need to check what the mysql daemon is actually working on internally. Mysql has a list of internal processes, try running the following:

mysql -u root -p -e "SHOW FULL PROCESSLIST"

if you have your password in your ~/.my.cnf you can use watch to keep an eye on your mysql processlist in a faux top format:

watch -n 1 mysql -u root -e \"SHOW FULL PROCESSLIST\"

If mysql is constantly doing 50%, then its probably working on something, if you can see the queries then there might be a way of optimizing it.

share|improve this answer

mytop - a command line utility for monitoring the threads and performances of MySQL performance. Using this you can able to find out which process is eating up your resources and you can optimize according to that.

Another way to optimize your mysql is mysqltuner script - its just a small perl script, when you run this on your machine, it will provide a recommended values to optimize your mysql server with your current resource setup.....

share|improve this answer
Thank you for notifying me about mysqltuner script :) I did optimization by recommendations from the script and this process is taking 50% less usage. – Luka Nov 29 '12 at 20:59

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