Results 1 to 3 of 3

Thread: How to find the cause of "too many connections error"

  1. #1
    Join Date
    Apr 2014

    How to find the cause of "too many connections error"


    For a while now I have been plagued by seemingly random 'too many connections' errors and it's driving me nuts!
    I wanted the MySQL database error log but HostPapa refused to let me have it.
    Without it I can't really see how any of my code is causing the errors. It was fine a month ago but just recently it has started causing the error from any user on any php page.

    Just to ensure it is not my code, how best can I test each page to see if it's causing too many connections errors?
    (Again though I don't think its the code because I have run the full site on a local WAMP server and cannot replicate the problem).


  2. #2
    Join Date
    Mar 2005
    Behind you...
    Have you checked any logs or analytics related to your site traffic? If everything in the code is fine then it seems an dramatic increase in connections would be related to an increase in page loads (or at least the scripts executing MySQL).

    I'm also not sure if the standard PHP error_log file tracks the 'too many connections' error as well or not, but if it does it'd be worth a look since it should tell you which script the error occured on. It's just a suggestion since you can't get access to the MySQL error logs. If you could find out which script is creating the issue then you'd at least have better insight as to what could be the cause (for instance, a script that might be getting exploited by bots/etc. that gets run repeatedly opening a large number of connections at a time).

    The only other thing I can think of (now that I re-read your original post) would be the method that you use to connect to MySQL. If it's not mysqli or PDO then perhaps this could be contributing to the problem. It's possible that perhaps HostPapa updated their version of PHP. The current version (5.5) has moved past the original MySQL methods and so you must now use mysqli or PDO.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  3. #3
    Join Date
    Apr 2014
    Thanks for the reply.
    Site traffic is minimal (about 20 connections a day) and I am using MySQLi.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center