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

Sometimes my website 'goes down' due to Mysql consuming all the resources, but I think it does not stop creating more httpd processes. Is that possible? If I restart apache, these processes disappear and I can see the CPU consumption by the mysql process go down slowly, and then the site is online again.

I'm having trouble finding the bottleneck anyway. The site has a lot of cronjobs (php scripts), and each one generates logs, which include the total execution time.

So my first thought was to try to find the script that took a lot of time, but that was not possible because it takes only one of them slowing the mysql server, to have all of them increasing their execution time.

Any advice?

Where can I learn how to find the bottlenecks?

Note: I'm on CentOS, apache 2, php 5.3, and mysql 5

share|improve this question
up vote 1 down vote accepted

You should start with the slow query log:

You may also want to check to see if max_used_connections is higher than max_connections:

SHOW VARIABLES LIKE 'max\_connections';
SHOW STATUS LIKE 'max\_used\_connections';
share|improve this answer
Should max_user_connections be higher or lower than max_connections? I have set both to 100000, because I was getting errors from scripts that were failing to connect to the DB. – HappyDeveloper Sep 7 '11 at 1:44
I was suggesting that you examine the values to see if the server hit its limit (max_used_connections >= max_connections). For setting the max_connections, have a look at Calculating Maximum Connections for MySQL Server – xofer Sep 7 '11 at 2:19

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.