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 a VPS and I am hosting a game site on it. Recently my CPU went to 3000% and memory is going near full.

When I checked the processes I found this process eating the CPU:

Pid-1571 (Trace) (Kill) 
CPU %-52.7 
Memory %-4.4
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ --pid-file=/var/lib/mysql/

What does this command do? Why is it running? How do I stop it?

share|improve this question
up vote 3 down vote accepted

This is MySQL, a database engine. I guess your site utilizes a MySQL database and the SQL queries are not optimal or the engine is not properly tuned. Anyway you can't simply stop it because your site will stop too.

share|improve this answer
is there is anyway to know what the SQL queries that eat up the cpu? – alhoseany Sep 2 '11 at 7:22
Sure, you can enable a mysql slow query log: There is a tool to process and summarize this log in the Maatkit utils package: – Alex Sep 2 '11 at 7:25

Depending on distribution, try

service mysql stop


/etc/init.d/mysql* stop

Be warned. Shutting it down will put you site offline, as it is the database.

share|improve this answer

Your Answer


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.