Dedicated Linux Server - Too Many Connections

My dedicated Linux server keeps going down, ‘too many connections’ (mysql, i think). I accept that as it is dedicated i need to fix and is not up to my hosting provider. However, surely they must be able to locate and identify the problem domain (there are about 50 domains on the server), but, i have asked time and time again, and they cannot. I have also offered to pay, but still no.

Does anyone know if this is, in fact, the case, that there is no such software to monitor server and identify a problem domain?

Or, can anyone suggest some software that will help me solve this problem, which has been going on for a year now.

Any help and guidance very much apreciated!

It seems that their web host have no idea how to help them in this situation.

Your host should be able to identify the source of the connections without much trouble. They can also help you to find the query that is causing the problem.

If you have root access, you can install mytop to see the mysql connections.

Are you using permanent connections to the the mysql from whatever server-side language (which one) your using?

A very crude way of telling how many connections your opening is to use a count each time the code that creates a connection to the database is run, the count for connections gets incremented by one then once the page has finished loading you echo/display the number of connections made and reset the count to 0

What control panel you are running? The control panels do have features to view the httpd/mysql connections. “too many connections” mostly appear when mysql max_connections limit is reached. You can check the active MySQL connections using following command :

mysqladmin processlist

This need to be executed as a root user from SSH. You can also setup a cron to log its output to a file after every few minutes so that you can check that later to see what were the mysql connections clogging the mysql server. Alternatively you can increase the mysql max_connections limit.

Add the following under [mysqld] section in my.cnf:

max_connections = xxx

where xxx is the number of connections that you want to allow.