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.

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/server.mydomain.com.err --pid-file=/var/lib/mysql/server.mydomain.com.pid

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

2 Answers 2

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.