Jump to content
AnotherAndrew

Site down, "too many connections"

Recommended Posts

My site suddenly went down. I haven't changed anything in days. I'm getting this message:

Fatal error: Exception: DB connect error 1040 - Too many connections (in /home/vg005web07/01/12/1031201/web/wire/core/ProcessWire.php line 96) #0 /home/vg005web07/01/12/1031201/web/wire/core/ProcessWire.php(46): ProcessWire->load(Object(Config)) #1 /home/vg005web07/01/12/1031201/web/index.php(166): ProcessWire->__construct(Object(Config)) #2 {main} in /home/vg005web07/01/12/1031201/web/index.php on line 203

Does anyone know what this means?

Share this post


Link to post
Share on other sites
Fatal error: Exception: DB connect error 1040 - Too many connections (in /home/vg005web07/01/12/1031201/web/wire/core/ProcessWire.php line 96) #0 

poplar guy must u.be 

mr.another

Weird. Now it is back up. 

part.of growning up.this  is

  a develper .need not theses things

Share this post


Link to post
Share on other sites

No idea what this is unless it's what it seems (too many people hitting your site at once?).

But I assume the ProCache module would avoid this happening as, I think, it means most people are served content without PHP or DB hits. I've no idea how it does it and like a high quality magic trick I am quite content never knowing ^_^ I'm just glad it's excellent.

  • Like 1

Share this post


Link to post
Share on other sites
But I assume the ProCache module would avoid this happening as, I think, it means most people are served content without PHP or DB hits. I've no idea how it does it and like a high quality magic trick I am quite content never knowing  ^_^ I'm just glad it's excellent.

This is true as the requests are delivered as static HTML files. So it doesn't touch the DB unless the request isn't cached. It is a great way to let your server handle a lot more traffic. But regardless of what caching is in place, if you start to see a "too many connections" message regularly, then it's time to talk to your web host to see if the amount of traffic you are getting would benefit from a higher-end hosting plan. There are also cases with some web hosts where the resources are simply oversold and you might see those kinds of MySQL error messages even if you aren't getting a lot of traffic. In those cases, it's a good idea to find a new web host. 

  • Like 1

Share this post


Link to post
Share on other sites

I finally checked into this with my host and they claimed that I wasn't "closing the connections". Also apparently the account has enough SQL connections to support the traffic.

I don't understand. I'm not experiencing this on other hosts.

The only way I'm aware if this problem is through a service (binary canary) that tells me if the site is down. Could it be that their constant pings are pushing the connections over the limit?

Share this post


Link to post
Share on other sites

I finally checked into this with my host and they claimed that I wasn't "closing the connections". Also apparently the account has enough SQL connections to support the traffic.

I don't understand. I'm not experiencing this on other hosts.

PHP handles closing connections automatically, so this shouldn't be a problem. According to one source this behavior could be a bit inconsistent between various PHP versions though -- which version of PHP is your host running?

The only way I'm aware if this problem is through a service (binary canary) that tells me if the site is down. Could it be that their constant pings are pushing the connections over the limit?

Depends on how they're pinging your site. Are they using HTTP or just checking if your machine replies from certain IP or..?

In the former case that could affect things a bit, although it still shouldn't make much of difference. If they're checking your site every minute or something like that you could still slow it down a bit. I'm not familiar with this particular service, but they'll probably have some way to decide the time between individual pings.. and if they don't, Pingdom is a very good and very configurable alternative :)

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By VeiJari
      Hello forum. I'm trying to figure out how to detect if current form has errors after saving it in pw admin page. This is so that our event location isn't added in database if we detect errors. But I can't seem to find a correct way to detect errors? I only found the wire()->errors() and it always triggers even if I don't have any errors. 
      How can I detect errors in a form?
      By error I mean $page->error('this is the red error');
    • By DevCat
      Hi,
      I'm trying to install ProcessWire on XAMPP localhost. I extracted the zip and put the files from master folder to website directory folder and when I go there with Firefox it says 404 page not found (no site configuration or install.php available). At least install.php surely is there. I'm doing WordPress installations on localhost almost every day and no problems. Does anyone here know what is cause for this error?
    • By sam-vital
      Hi,
      So I'm working on my site, getting round to completing it. I remember that I haven't checked at all what it will be like on other devices, so that's my next task.
      I went to the index page and I get hit with this error:
      Fatal error: Exception: SQLSTATE[HY000] [2002] Connection refused (in /var/sites/b/mysite.org/public_html/wire/core/ProcessWire.php line 377) #0 /var/sites/b/mysite.org/public_html/wire/core/ProcessWire.php(209): ProcessWire\ProcessWire->load(Object(ProcessWire\Config)) #1 /var/sites/b/mysite.org/public_html/index.php(52): ProcessWire\ProcessWire->__construct(Object(ProcessWire\Config)) #2 {main} in /var/sites/b/mysite.org/public_html/index.phpon line 64
      All I have done from the last code update was change a links target to blank, pushed the update and tested it. Now my site is broken? Went back and changed to the original file and I'm still getting the error.
      I really don't understand what has happened. I am an ok {6 months} web developer with this being my first experience of PW.
      All help is appreciated 🙂
    • By Sergio
      All of a sudden, with nothing changed on the database or server, a website was getting error when doing a search:
      Error: Exception: SQLSTATE[HY000]: General error: 23 Out of resources when opening file './your-database-name/pages_parents.MYD' (Errcode: 24 - Too many open files) (in /home/forge/example.com/public/wire/core/PageFinder.php line 413) #0 /home/forge/example.com/public/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #1 /home/forge/example.com/public/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___find', Array) #2 /home/forge/example.com/public/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'find', Array) #3 /home/forge/example.com/public/wire/core/PagesLoader.php(248): ProcessWire\Wire->__call('find', Array) #4 /home/forge/example.com/public/wire/core/Pages.php(232): ProcessWire\PagesLoader->find('title~=EAP, lim...', Array) #5 /home/forge/example.com/public/wire/core/Wire.php(383): ProcessWire\Pages->___find('title~=EAP, lim...') #6 /home/forge/example.com/public/wire This error message was shown because: you are logged in as a Superuser. Error has been logged.  
      I tried several things, listed in this thread: https://serverfault.com/questions/791729/ubuntu-16-04-server-mysql-open-file-limit-wont-go-higher-than-65536
      But for some reason, MySQL was not getting its limit increased, but in the end, the one that did the trick was this:
      This worked for me on Ubuntu Xenial 16.04:
      Create the dir /etc/systemd/system/mysql.service.d
      Put in /etc/systemd/system/mysql.service.d/override.conf:
      [Service] LimitNOFILE=1024000 Now execute
      systemctl daemon-reload systemctl restart mysql.service Yes indeed, LimitNOFILE=infinity actually seems to set it to 65536.
      You can validate the above after starting MySQL by doing:
      cat /proc/$(pgrep mysql)/limits | grep files
    • By phillipschmitz
      500 Error after the latest Core Update.
      I have no idea why and what causes the problem, or how to solve it. (Maybe reupload the wire folder?)

       

      Any ideas? 
×
×
  • Create New...