We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18641
    • 22 Posts
    Please can somebody please help, and explain what this means and where the problem is?

    Is it with my server or is it a problem with a file? I am despeerate to fix this quick!

    many many thanks in advance.

    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
      Error: mysql_connect(): Too many connections
      Error type/ Nr.: Warning - 2
      File: /hsphere/local/home/urbanspa/website.com/manager/includes/extenders/dbapi.mysql.class.inc.php
      Line: 85
      Line 85 source: if (!$this->conn = ($persist ? mysql_pconnect($host, $uid, $pwd) : mysql_connect($host, $uid, $pwd))) {

    Parser timing
      MySQL: 0.0000 s s (0 Requests)
      PHP: 0.0253 s s
      Total: 0.0253 s s
      • 22815
      • 1,097 Posts
      First thing to try is to disable stats.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 7455
        • 2,204 Posts
        funny thing is that this happend today with the modxsite and forums itself.

        dutch time 11:52 am

        modxcms.com/forums:
        
        Connection Problems
        Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later. 
        
        ________________________________________________________________________________________________________________________
        
        http://modxcms.com/blog.html:
        
        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource: 
        « PHP Parse Error » 
          
        PHP error debug 
          Error:  mysql_connect() [function.mysql-connect]: Too many connections   
          Error type/ Nr.:  Warning - 2   
          File:  /home/httpd/vhosts/modxcms.com/httpdocs/manager/includes/extenders/dbapi.mysql.class.inc.php   
          Line:  48   
          Line 48 source:  if(!$this->conn = ($persist ? mysql_pconnect($host, $uid, $pwd):mysql_connect($host, $uid, $pwd))) {    
          
        Parser timing 
          MySQL:  0.0000 s s (0 Requests) 
          PHP:  0.2138 s s   
          Total:  0.2138 s s  
        
          follow me on twitter: @dimmy01
          • 25663 MODX Staff
          • 12,272 Posts
          Ahhh... you tried to connect at MODx while a backup was going on. It was a bit resource starved I’m afraid, and MySQL just refused to cooperate!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 18641
            • 22 Posts
            many thanks, I will disable stats – just curious as to why that might work? is it as simple as it just reduces the load on the database? It only seems to last for a short while, 10-30min.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, it’s probably just that simple. If your host server has as many as 400 websites hosted on it, which is quite possible, and it gets busy, the database can get overwhelmed. Of course, that also depends on how the database engine is configured; it can be set to allow more or less connections at a time.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 18641
                • 22 Posts
                Disabling stats has made a huge difference. The site I’m working on gets roughly 500 visits per day, and I guess the MySQL server simply couldn’t cope. I should probably move it to a better host. Thanks for the tip!

                – hoho

                  • 25663 MODX Staff
                  • 12,272 Posts
                  500 visitors a day is definitely not a load that should kill a site. Sounds like a shared server that might have a few too many accounts using the same resources.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 18641
                    • 22 Posts
                    Yeah that’s exactly right... It’s a client site... disabling stats is only just keeping their head above water, and they won’t move it. huh

                    – Cheers guys
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Can’t help someone who refuses to help themselves. wink
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me