Results 1 to 7 of 7

Thread: mysql_pconnect(): Too many connections

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Posts
    5

    Angry mysql_pconnect(): Too many connections

    Someone on my shared server is hosing my site. I know my site isn't sucking all the bandwith. I checked my status logs. Earlier I couldn't even access my site, now I get the error "mysql_pconnect(): Too many connections". Please boot these bandwith-sucking loozers.


    www.lowing.org

  2. #2
    Senior Member Buddha's Avatar
    Join Date
    Mar 2004
    Location
    Florida USA
    Posts
    825

    Default

    No one should be using mysql_pconnect() on a shared server. If you can't connect to your database mysql_pconnect() could be the reason.

    [ edit - to correct double negative ]
    Last edited by Buddha; 10-01-2004 at 06:11 AM.
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Posts
    5

    Default

    I just changed it to mysql_pconnect to try to solve the problem.

  4. #4
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,640

    Default

    Please do not use persistent connections. They should be disabled anyways but if we catch someone using them it will result in the domain being suspended.

  5. #5
    Junior Member
    Join Date
    Oct 2004
    Posts
    5

    Default

    I just changed the mysql_connect to mysql_pconnect to fix the broken server in the first place. Now my other site www.scsclub.com is dead and won't even resolve. If I could FTP to the site I'd change it back.
    Last edited by AndrewT; 10-01-2004 at 07:12 AM.

  6. #6
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,640

    Default

    Once again your post has been edited for language. One more time and you will no longer be posting here.

  7. #7
    Senior Member sdjl's Avatar
    Join Date
    Mar 2004
    Location
    London, UK.
    Posts
    502

    Default

    n8f8, just so you know why mysql_pconnect(); is bad, here's an excert from the PHP manual, which can be viewed here: http://php.net/mysql_pconnect

    The connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()).
    This basically means that a process on the server will constantly be open to the MySQL server using the login details you gave it.
    So why is this bad on a shared server? Another excert, this time from an article on http://www.zend.com

    The mysql_pconnect() function was designed to provide a mechanism for reducing the cost of establishing and closing connections to the MySQL server. Unfortunately, due to an interaction between the architecture of the Apache server and the architecture of PHP, high traffic on a site that used pconnects could quickly clog up the MySQL server with many unused connections that could prevent many of the active connections from accessing the database.
    There's not a great deal of detail in the PHP manual as to why using pconnect could be bad, so it's always useful to take these notes (and warnings) in your stride and remember them for next time

    I hope this helps clarify anything that you may not have understood. If you need to ask any questions about the function, fire away

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

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
  •