Too Many MySQL connections
-
Our ISP has detected a huge amount of MySQL errors being generated by the Wordfence plugin.
So many in fact that they have asked us to remove it as our error file has racked up to 12MB in under 2 hours.
Here’s a sample of the error messages:
[Thu Nov 29 03:03:36 2012] [error] [client 107.21.*.*] PHP Warning: mysql_connect() [function.mysql-connect]: User [removed] already has more than ‘max_user_connections’ active connections in /home/sites/[removed]/public_html/wp-content/plugins/wordfence/lib/wfDB.php on line 56[Thu Nov 29 03:03:36 2012] [error] [client 107.21.*.*] PHP Warning: mysql_ping() expects parameter 1 to be resource, boolean given in /home/sites/[removed]/public_html/wp-content/plugins/wordfence/lib/wfDB.php on line 48
That goes on pretty much every few tenths of a second.
Are the MySQL connecitons being closed and managed properly in your private function connectHandle() method?
How many times are you calling mysql? You also seem to be using mysql_ping which even PHP discourages use of.
Why do you need to make so many mysql connections? What info are you reading/writing to the DB?
Can’t you use WP Transients for that?
Cheerz,
Wil.
- The topic ‘Too Many MySQL connections’ is closed to new replies.