We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14951
    • 151 Posts
    I just noticed that a few days ago I had the following in my MODX error log:
    [2011-10-20 16:06:38] (ERROR in xPDO::connect @ /home/westernt/public_html/core/xpdo/xpdo.class.php : 344) SQLSTATE[42000] [1203] User westernt_modx already has more than 'max_user_connections' active connections
    [2011-10-20 16:06:38] (ERROR in xPDO::connect @ /home/westernt/public_html/core/xpdo/xpdo.class.php : 344) SQLSTATE[42000] [1203] User westernt_modx already has more than 'max_user_connections' active connections
    [2011-10-20 16:06:38] (ERROR in xPDO::connect @ /home/westernt/public_html/core/xpdo/xpdo.class.php : 344) SQLSTATE[42000] [1203] User westernt_modx already has more than 'max_user_connections' active connections
    [2011-10-20 16:06:38] (ERROR @ /~westernt/index.php) Error preparing statement for query: SELECT `modChunk`.`id` AS `modChunk_id`, `modChunk`.`name` AS `modChunk_name`, `modChunk`.`description` AS `modChunk_description`, `modChunk`.`editor_type` AS `modChunk_editor_type`, `modChunk`.`category` AS `modChunk_category`, `modChunk`.`cache_type` AS `modChunk_cache_type`, `modChunk`.`snippet` AS `modChunk_snippet`, `modChunk`.`locked` AS `modChunk_locked`, `modChunk`.`properties` AS `modChunk_properties` FROM `modx_site_htmlsnippets` AS `modChunk` WHERE `modChunk`.`name` = ?  - 


    I'm not sure if this is something I should be worried about or not? The reason I went exploring into the error log was due to the fact that some resources at random would use the previous development server pass for [[+site_url]] even though I can find no trace of the old paths in the database and have done a complete reinstall of mode.

    I somehow doubt that this error message is related, but it looked intimidating none-the-less so I thought I'd get an idea of what the issue might be.

    Thanks for any tips!
    -Jared
    • The messages mean your provider is limiting the number of mysql connections your site can attempt to open at any one point in time.
        • 14951
        • 151 Posts
        Thanks again @opengeek!

        I've never seen this before with any of my other sites. Apparently my hosting company (Site5) limits to 15 connections.

        This doesn't mean that only 15 users can be viewing the site at the same time does it?

        What determines how much and how often a database connection is established?

        Perhaps I need to hire someone to optimize the site a bit better?

        Thanks!
        -Jared
          • 22840
          • 1,572 Posts
          Well Well,

          I've had the exact same issue tonight on my company's VPS with site 5, apparently they were limiting us to 20 which they have happily updated to 60 after 2 hours of some of our sites being down ( no modx sites ). Only issue I had with that is I went onto live chat to tell them what the problem was and it still took them 2 hours to sort it.

          If your not on your own dedicated server / VPS I don't think they will up it ( in my experience ).
          • Paulp is correct, they will only raise the limit if you are on a VPS server an only if you ask them to do so.

            The connection limit should only affect high traffic sites where 15 or more users perform an action that interacts with the database at the same time.

              Patrick | Server Wrangler
              About Me: Website | TweetsMODX Hosting
            • Quote from: jaredloman at Oct 24, 2011, 10:14 PM
              I've never seen this before with any of my other sites. Apparently my hosting company (Site5) limits to 15 connections.

              This doesn't mean that only 15 users can be viewing the site at the same time does it?
              Unless you are sure that your site is not making a connection on every page load, it certainly would be limiting it to 15 simultaneous connections.

              Quote from: jaredloman at Oct 24, 2011, 10:14 PM

              What determines how much and how often a database connection is established?

              Perhaps I need to hire someone to optimize the site a bit better?
              It wouldn't be a bad idea; there is a lot that can be done to improve the situation. First, unless you customize the session handling in MODX Revolution, it will make a connection on every request, as it uses database session handling by default. You can set session_handler_class to blank in the manager to use the regular file-based PHP session handler and avoid the session connection requirement. But you will still need to make sure everything that might create a database connection is cacheable so that other Elements that make up a Resource in MODX do not trigger that connection on every page view.

              Manager requests are even more demanding because it is broken up into a bunch of smaller AJAX requests which while they are small and relatively efficient, require several connections to be made when loading a single manager view.
                • 14951
                • 151 Posts
                Thank you for your continued insight!

                I'm assuming that a database connection is only made momentarily and not held through the entire time the user is on the site?

                I guess I'll just have to keep an eye on the situation.. Haven't seen it pop up in the error log since so it could have just been a fluke...

                Again, thank you sincerely!
                -Jared