Announcement

Collapse
No announcement yet.

Regularly receiving "too many connections" errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regularly receiving "too many connections" errors

    Hello

    Every day we receive a number of "too many connections" errors between approx. 3am and 3.30am BST, such as the following:

    Database error in vBulletin :
    mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections
    /usr/local/www/data-dist/vbulletin/includes/class_core.php on line 274

    MySQL Error :
    Error Number :
    Date : Tuesday, June 10th 2008 @ 03:28:00 AM
    Script : http://192.168.1.101/talkingpoint/discuss/cron.php
    Referrer :
    IP Address : 192.168.1.101
    Username :
    Classname : vb_database
    Our Apache access logs show that, more often than not, no users are accessing our forum. At 3am every day, we run newsyslog to archive our web server logs. We also have a script, running at approximately the same time, which backs up our MySQL database.

    After reading a number of posts on this site, we have:
    1. Increased our MySQL max_connections a number of times (current value is 600)
    2. Set the Crawl-Delay in our robots.txt to 10 seconds
    3. Set mysqldumpto run in quick mode (command line parameter -q)

    Not really sure what else to try... Any ideas?

    Cheers

  • #2
    I'm afraid you will need to keep increasing max_connections until you no longer get that error. Make sure you stop and start MySQL after editing my.cnf. Shut down your forums first of course.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Originally posted by mgthomas View Post
      Hello

      Every day we receive a number of "too many connections" errors between approx. 3am and 3.30am BST, such as the following:

      Our Apache access logs show that, more often than not, no users are accessing our forum. At 3am every day, we run newsyslog to archive our web server logs. We also have a script, running at approximately the same time, which backs up our MySQL database.

      After reading a number of posts on this site, we have:
      1. Increased our MySQL max_connections a number of times (current value is 600)
      2. Set the Crawl-Delay in our robots.txt to 10 seconds
      3. Set mysqldumpto run in quick mode (command line parameter -q)

      Not really sure what else to try... Any ideas?

      Cheers
      Your mysqldump is probably grabbing a read lock on the database (it needs to do that to get an accurate backup). This will cause any database queries to hang until the backup is complete, which can lead to database connections 'stacking up' and causing the too many connections error. I suspect this is what's happening to you based on what you described.

      If this is the only time you are getting this error, you should decide if it is worth trying to eliminate it. One option: If you have or are able to set up mysql replication, you can do your backup from a slave instead of the master, which should eliminate the problem entirely.

      Comment


      • #4
        Hello Gunzour

        Your mysqldump is probably grabbing a read lock on the database
        I was hoping mysqldump -q would stop that happening.

        Excellent idea with the replication. I don't suppose you know if we could run two instances of MySQL on one server to run the replication?

        Ta
        Last edited by mgthomas; Wed 11th Jun '08, 4:12am. Reason: accidentally put code tag in text

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X