1

I'm running a 2GB Centos 5.9 server with the standard LAMP setup. I'm running a wordpress website so it's nothing to demanding performance wise.

However the MySQL server seems to keep crashing as I get an Error Connecting To Database when I try to access my wordpress site. I checked the CPU and it's running at 100% and the RAM is also at 100%.

I've tried

service mysqld restart

and everything goes back to normal for about 10 minutes and then it crashes again.

I've also tried adjusting the my.cnf file and also httpd.conf file but this hasn't fixed it.

When I run

netstat -ntu | awk '{print $5}' | cut -d':' -f1 | grep "^[0-9]" | sort -g | uniq -c

I get the following output:

  1 31.222.135.11
  1 50.56.142.152
  1 50.57.61.11
  1 78.136.44.13
  2 78.19.241.93
201 127.0.0.1

Why are there 201 connections on my loopback address? Thanks for your help in advance.

0

First of all, you should check if you are able to connect directly to the MySQL server via the mysql client. Just in case you have reached the maximum number of connections or there are other server problems (out of memory, bad disk etc etc)

If you are able to talk straight to the database, you should check the databases' processlist and see if anything is taking to much to run etc etc

Check your MySQL's error log.

Lastly, check you apache2 php.ini if the following are enabled (if the problem is too many connections to the database):

mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.