• Welcome to WebsiteBaker Community Forum. Please log in or sign up.
Welcome, Guest
News
Support WebsiteBaker
Your donations will help to:
PayPal
  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!
You can donate by clicking on the button below.

Too many connections - site crash

Started by Pmaurer, September 12, 2008, 04:20:43 AM  ( Read 18,955 times )

Pmaurer

I searched for another thread like this...but none were related to this problem.

At least 3 or 4 times a week my site goes down and i get this error:

Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home/chevell1/public_html/wb/framework/class.database.php on line 61
Too many connections

It isnt just the wb portion of the site that crashes either....it's everything (XMB forums, etc)

Is there any way to fix this? I've already spent weeks yelling at my Host and they just directed the problem here :-|. thanks in advance!


    BerndJM

    Hi,

    I think, this is the important part of your post:

    QuoteIt isnt just the wb portion of the site that crashes either....it's everything (XMB forums, etc)

    Why? - Really simple:
    the reason for the message "Too many connections ..." is mainly because database-connections are'nt proberly closed.
    I (me personally) don't know a hoster who set a lower limit to the mysql-connections as the default is (because it's not necessary).
    I never seen a WB installation that causes this problem..

    Maybe a "third-party-software" makes this problem (XMB forums?) ...
    Maybe you're using a module in your WB-installation which doesn't use the "build-in" database connectivity mechanism ...

    Regards Bernd

      Pmaurer

      okay.....but how do i remedy the problem?

        BerndJM

        ummmh ...
        a "nice" question ....
        I don't think, that you're able to de-activate the one or other functionality in your website, to have a look what happens?

        Maybe it would be a good idea to tell us a little bit more about your configuration:
        - what WB Version you use
        - which modules you've installed
        - what a server enviroment we're talking about
        - what's this "XMB-forums"
        - is there a URL to have a look at your site

        Regards Bernd

          Pmaurer

          my site is http://chevelleonline.net/wb/:
          to be honest, i dont know what version of wb i'm running.
          -xmb is the forum program i use
          -the only other software i'm using is Coppermine gallery for photos.


            thorn

            Hello,

            can you fetch some mysql-settings from your db, just to check whether the settings are ok.
            Please add a page from type CODE, and copy&paste this code into it
            echo "Variables<br>";
            $query = $database->query("SHOW VARIABLES WHERE Variable_Name RLIKE
            '(table_cache|max_connections|max_user_connections|open_files_limit|connect_timeout|^version.*)'"
            );
            if(
            $query->numRows() > 0) {
             while(
            $res = $query->fetchRow()) {
               echo
            "{$res[0]} = {$res[1]}<br>";
             }
            }
            echo
            "<br>Status<br>";
            $query = $database->query("SHOW STATUS WHERE Variable_Name RLIKE
            '(Max_used_connections|^Open_.*)'"
            );
            if(
            $query->numRows() > 0) {
             while(
            $res = $query->fetchRow()) {
               echo
            "{$res[0]} = {$res[1]}<br>";
             }
            }


            Since mysql 5.1, it's possible to set 'quotas' per user (max_connections, max_user_connections, max_updates, max_questions in mysql.user).
            See http://dev.mysql.com/doc/refman/5.1/en/user-resources.html
            Maybe your hoster make use of this?

            thorn.

              Pmaurer

              Variables
              connect_timeout = 10
              max_connections = 600
              max_user_connections = 60
              open_files_limit = 33378
              table_cache = 16384
              version = 5.0.45-community-log
              version_comment = MySQL Community Edition (GPL)
              version_compile_machine = x86_64
              version_compile_os = unknown-linux-gnu

              Status
              Max_used_connections = 17
              Open_files = 9393
              Open_streams = 0
              Open_tables = 5437

                thorn

                Hello,

                looks fine at all, ... but i'am not a db-professional.

                Do you use persistent connection (pconnect) in Coppermine or xmb? --> deactivate

                thorn.

                  Pmaurer

                  no, i'm pretty sure i'm not using pconnect for either of those.... :?


                    \n\n