visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: mySQL and excessive CPU use.


By: CAE11 U.S.A.  Date: 09/07/2003 00:00:00  English  Points: 125 Status: Answered
Quality : Excellent
I've noticed a server running with a higher load recently and I
believe I've narrowed it down to mySQL. Taking a look at
Cpu/Memory/Mysql Usage History in WebHost Manager I notice this:

User Domain %CPU %MEM Mysql Processes
mysql 100.98 161.94 0.0

Top Process %CPU 24.3 /usr/sbin/mysqld --basedir/
--datadir/var/lib/mysql --usermysql
--pid-file/var/lib/mysql/s1.critticage.com.pid --skip-locking
Top Process %CPU 22.6 /usr/sbin/mysqld --basedir/
--datadir/var/lib/mysql --usermysql
--pid-file/var/lib/mysql/s1.critticage.com.pid --skip-locking
Top Process %CPU 19.8 /usr/sbin/mysqld --basedir/
--datadir/var/lib/mysql --usermysql
--pid-file/var/lib/mysql/s1.critticage.com.pid --skip-locking

Three identical processes. Is there any reason why there should be
three running, each taking up a lot of CPU? Or is it just being hit
too hard by the scripts being run?

I'm afraid I'm not much of a server admin, so any help would be
appreciated (as long as it's "dumbed" down sufficiently ;-).
By: VGR Date: 09/07/2003 02:15:00 English  Type : Comment
frankly : kill them all and relaunch one with :
safe_mysqld --user=mysql &
By: CAE11 Date: 09/07/2003 02:22:00 English  Type : Comment
Will this stop it from occuring again?

And I feel kind of stupid, but I have no idea how to do what what you described.
By: CAE11 Date: 09/07/2003 02:41:00 English  Type : Comment
Ok, so I just restarted the mySQL service and it gave me the following message:

root 24645 0.6 0.4 2088 1036 ? S 02:26 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/s1.critticage.com.pid

However, there's still the same three processes running.
By: VGR Date: 09/07/2003 02:43:00 English  Type : Answer
In fact, you've three instances of the server. Given they apparently use the same command line, they use the same configuration file and datadir settings, in other words they serve no purpose and are redundant :D
Moreover, they are set up to use the same PID file, so basically they "walk on each other's feet" :D
The best that could happen is that 2 out of the 3 are blocked-zombified-almost-dead and the third works as expected :D


ps -aux | grep mysql
-> gives you the process IDs (PID) of the three processes to kill

then do three time s:
kill -9 PID
--> where PID is each PID noted above

"cleaner" methods involve "mysqladmin shutdown" but given your situation, a "kill" seems appropriate :D

Do register to be able to answer

EContact
browser fav
page generated in 860.678200 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page