Hundreds of MySQL processes!

Blue|Fusion

Well-Known Member
Sep 12, 2004
377
0
166
Cleveland, Ohio
Hello,

I have had a problem on one of my servers where tons of MySQL processes start spawning out of what seems to be nowhere. I am pretty sure, however, that there is some script causing this. Recently, the server has been unplugged from the internet and when it did come back online, MySQL was normal, with an uptime of 33 days. It has been running 1 day now and there are near 200 mysqld processes in ps -aux.

When I try to stop the service, it waits for a while to stop, then it gives up on exiting nicely and forcably kills it. Even then, there are a whole bunch of mysqld processes but killall mysqld gets rid of them.

Within a few minutes of starting mysql again, the processes start spawning like crazy. When the processes do get very high, I get the error "Too Many Connections" in cPanel's servup.

I am very open to ideas now, any tips?

OS: Fedora Core 1
cPanel 10.0.0-CURRENT-6
MySQL 4.1

By the way, this has been happening for over a month and also with MySQL 4.0.22 and 4.0.23.
 

Blue|Fusion

Well-Known Member
Sep 12, 2004
377
0
166
Cleveland, Ohio
I set max connections to 500 on all of my servers, except about a month ago when this started giving me problems, I pushed it up to 1000 connections, even 2000, and still it maxes out. When I try to load the connections data in WHM, it shows 1 eximstats sleeping and the root user getting the connection table.
 

netlook

Well-Known Member
Mar 25, 2004
334
0
166
Try uncomment log-bin option in /etc/my.cnf like:

#log-bin

This should help.
 

elleryjh

Well-Known Member
Apr 12, 2003
479
0
166
I believe I am having the same problem. Did you get this fixed? Any new ideas?
 

Infopro

Well-Known Member
May 20, 2003
17,091
516
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Do you know what the username is on the database that's showing up? Can you check the htaccess in that account to see whats in it?

I had a similar problem recently and removing what the user put into the htaccess file stopped this problem for us. He had used the hotlink feature in cPanel.
I haven't tried to reproduce the problem though.

Not sure if this is any help at all but can't hurt to mention it.
 

WestBend

Well-Known Member
Oct 12, 2003
173
0
166
mysqld is a multi-threaded daemon. The Hundreds of processes are really just on process. So 150MB RSS is the total for all threads being opened. Your seeing lots and lots of threads which is ok however it sounds like your my.cnf needs to be altered. Check the sample my.cnfs that come with mysql. heavy.cnf etc and tweak as necessary.

http://www.trafficg.com/mysql/

Mytoolkit - MySql and Server Helper Scripts

Awesome set of scripts that will show you things like tmp_table usages. Make sure you have enough set in the caches and reserve space so it is not having serious IOWAIT times.