Random MySQL Connection Failures
Posted: Mon May 25, 2009 2:16 pm
Hi there. I found this place thanks to this thread which may or may not have a similar problem to my own. I really hope someone can help.
I've just moved from a single server setup, with the database on the same server - to a dual server setup, with our CMS moved to the new server (A), and site front-ends remaining on the old server (B).
Our PHP error log on (A) has since been showing random connection failures, when attempting to connect to the DB over on (B).
I've put in place some logging procedures to try and catch where abouts these problems are occuring.
99% of the time, they seem to be happening in one of two scripts.
The first is a script which is scheduled to run every minute, all the time.
According to the logs, this failure always occurs at xx:xx:21, ie. 21 seconds into the minute of the hour, both of which can be anything, but there are some odd patterns forming. Nothing rigid to be sure though.
An example of this error is:
[24-May-2009 09:50:21] PHP Warning: mysql_connect(): Can't connect to MySQL server on '***.***.***.***' (10065) in Z:\whatever.php on line 2160
Standard stuff, although I don't seem to be able to find much on that 10065 error code.
The other happens in a script which is within our CMS, and again contacts the DB on server (B).
It is a script which remains open and refreshes itself regularly.
An example of this error, is almost identical:
[25-May-2009 13:49:10] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on '***.***.***.***' (10065) in Z:\whatever.php on line 2160
So the thing these 2 scripts have in common, is that they're hit regularly. The first, every minute on a scheduler. The other, a user defined interval, refreshed in a web page.
It's just so random, I can't put my finger on the cause.
I even uninstalled the MySQL DB on Server (B) and updated it to the latest version, matching the version of (A), just to be sure. This made no difference.
I can only think it's because something is getting full, due to the regular requests by these scripts?
Any help would be really appreciated. Thanks, Gav
I've just moved from a single server setup, with the database on the same server - to a dual server setup, with our CMS moved to the new server (A), and site front-ends remaining on the old server (B).
Our PHP error log on (A) has since been showing random connection failures, when attempting to connect to the DB over on (B).
I've put in place some logging procedures to try and catch where abouts these problems are occuring.
99% of the time, they seem to be happening in one of two scripts.
The first is a script which is scheduled to run every minute, all the time.
According to the logs, this failure always occurs at xx:xx:21, ie. 21 seconds into the minute of the hour, both of which can be anything, but there are some odd patterns forming. Nothing rigid to be sure though.
An example of this error is:
[24-May-2009 09:50:21] PHP Warning: mysql_connect(): Can't connect to MySQL server on '***.***.***.***' (10065) in Z:\whatever.php on line 2160
Standard stuff, although I don't seem to be able to find much on that 10065 error code.
The other happens in a script which is within our CMS, and again contacts the DB on server (B).
It is a script which remains open and refreshes itself regularly.
An example of this error, is almost identical:
[25-May-2009 13:49:10] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on '***.***.***.***' (10065) in Z:\whatever.php on line 2160
So the thing these 2 scripts have in common, is that they're hit regularly. The first, every minute on a scheduler. The other, a user defined interval, refreshed in a web page.
It's just so random, I can't put my finger on the cause.
I even uninstalled the MySQL DB on Server (B) and updated it to the latest version, matching the version of (A), just to be sure. This made no difference.
I can only think it's because something is getting full, due to the regular requests by these scripts?
Any help would be really appreciated. Thanks, Gav