Too many connection error

Discussion in 'MySQL' started by Om ji Kesharwani, Nov 2, 2010.

  1. #1
    I have developed a community site and for testing it i have uploaded on shared hosting.
    But when more users login at the same time. It shows to many connection error.

    What can be the best solution?

    mysql_close() or any other option?
     
    Om ji Kesharwani, Nov 2, 2010 IP
  2. Blue Link Media

    Blue Link Media Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Honestly, you should move to ( at least ) a VPS.
    The solution is to increase max_connections value - none ( at least I haven't heard of one ) of the shared hosting service providers will allow you to do that.
     
    Blue Link Media, Nov 2, 2010 IP
  3. thinkdj

    thinkdj Peon

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are you on a shared hosting? Shared hosts put a very small value for max number of persistent connections. Like Blue Link Media mentioned, we are not aware of shared hosts that allow you to edit the db connection settings.
    Either reduce the queries (optimize them to fetch multiple data in one go) or move to a VPS
     
    thinkdj, Nov 3, 2010 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Optimize your queries, use mysql_close() and move to VPS/dedicated server. You can not increase connections limit on a shared server.
     
    mwasif, Nov 4, 2010 IP
  5. redditor

    redditor Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Make sure you set these really low in "my.cnf"

    interactive_timeout=1
    wait_timeout=2
    connect_timeout=2
     
    redditor, Nov 6, 2010 IP