WordPress.org

Support

Support » Plugins and Hacks » Wordfence Security » [Resolved] Too Many MySQL connections

[Resolved] Too Many MySQL connections

Viewing 7 replies - 1 through 7 (of 7 total)
  • It would be nice for those of us having this issue to get a valid answer/solution for the problem. Like Lime Canvas, I too am seeing this problem occur and need an answer to his question.

    Make that three cases! 😉

    You could try unchecking the “Enable Live Traffic View” that may help.

    Plugin Author Wordfence

    @mmaunder

    Hi folks,

    You need to set your max_user_connections to the number of Apache web server children X 2. This is the absolute minimum and ideally it should be X 4.

    DB connections don’t consume much resources and having a separate connection for Wordfence gives a substantial performance boost. If your host is stingy on memory for your DB server, find another host.

    We don’t have any issues regarding max_user_connections with premium hosts.

    MickeyRoush is correct that disabling live traffic may help with this. (Thanks for the suggestion!)

    Having said that, I do have an urgent issue logged to try and use the WPDB DB handle instead of creating a separate connection. So expect a possible improvement in another release.

    Closing this issue because this forum is not a bug tracking system and I’ve given you a comprehensive response.

    Regards,

    Mark.

    Thanks for your response @mmaunder

    I expect that may people running sites on shared hosting, like mine, will not be able to use your plugin as we have no control over the max_user_connections setting 🙁

    Regards,
    Wil.

    Plugin Author Wordfence

    @mmaunder

    Thanks Wil. I’ll see if I can improve this.

    Regards,

    Mark.

    Mark,

    I’m also getting these messages on my error_log:

    PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home1/mydomain/public_html/wp-content/plugins/wordfence/lib/wfDB.php on line 56
    PHP Warning:  mysql_ping() expects parameter 1 to be resource, boolean given in /home1/mydomain/public_html/wp-content/plugins/wordfence/lib/wfDB.php on line 52
    PHP Warning:  mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home1/mydomain/public_html/wp-content/plugins/wordfence/lib/wfDB.php on line 57

    Unfortunately, I did not quite understand what you said:

    You need to set your max_user_connections to the number of Apache web server children X 2. This is the absolute minimum and ideally it should be X 4.

    How can I check my number of Apache web server children?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Too Many MySQL connections’ is closed to new replies.
Skip to toolbar