Mysql – Too many thesql instances. How to kill

instanceMySQLmysqldprocess

I should be ashamed of myself, for asking, I know.

Check out this screenshot attached. enter image description here

My server, which is indeed not seeing HUGE amounts of traffic, should not be this overloaded. Mysql is having a party and everyones invited. The thing is I don't like these kinds of wild parties.

How do I kill this stuff? How do I regulated it so that it doesn't keep happening? Pretty soon my host is going to call the police and the party will be over for everyone.

Best Answer

Don't be fooled by what you see.

mysqld will not multiple instances on the same datadir and ibdata1. How do I know this?

On Sep 26, 2014 I answered MySQL got signal 11 error and slave is down. In my answer, I mentioned how InnoDB Architecture only allows one mysqld process to open a Master Thread to ibdata1.

Therefore, if you do not see the following lines in your error log

6 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2014-09-26 12:51:53 14166 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2014-09-26 12:51:53 14166 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

In light of these things, I assure you, you do not have multiple mysqld processes.

What, then, are you seeing? Those are actual DB Connections emanating from the mysqld instance. I have seen this freakish display come from source-compiled versions of mysqld. I have mentioned it in passing in my old post innodb_buffer_pool_size not changed and Identical mysql processes (ServerFault). My suspicion is that the OS is manifesting DB Connections as if they were mysqld processes. On the contrary, they are just ordinary DB Connections.

You should run this in Linux

ps -ef | grep mysqld | grep -v grep | wc -l

You should get an output of 2 (1 for mysqld and 1 for mysqld_safe)

If you get just 1, you probably got a very old version of MySQL.