MySQL limit?

Discussion in 'MySQL' started by siraxi, May 21, 2006.

  1. #1
    Hi

    I need help to understand this issue:

    I just installed vBulletin and imported posts from phpBB. From time to time it gives this error and MySQL stops functioning for an hour or so:

    "Database error in vBulletin :

    mysql_pconnect(): Too many connections
    /path_to_forum/includes/class_core.php on line 279"

    I contacted webhosting support and they said:
    I wonder if this is normal... :confused:
    Is it because of my webhost or because of the new installation of vBulletin...?
     
    siraxi, May 21, 2006 IP
  2. iowadawg

    iowadawg Prominent Member

    Messages:
    10,918
    Likes Received:
    811
    Best Answers:
    0
    Trophy Points:
    380
    #2
    Many webhosts put a limit on mysql as to connections to not overload their servers, etc.

    Ask your webhost what your limit is, to increase it (may cost more), give you more mysql storage, or find another host.
     
    iowadawg, May 21, 2006 IP
  3. Hoth

    Hoth Well-Known Member

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    You're using persistent connections. That leads to having more connections open at a time so it's generally a bad idea. Use regular connections (mysql_connect()).

    I thought recent vBulletin versions defaulted to mysql_connect instead of mysql_pconnect though. Anyhow vBulletin people would know where to change it.
     
    Hoth, May 21, 2006 IP
  4. siraxi

    siraxi Peon

    Messages:
    333
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for your responses.

    This is the latest version of vBulletin running and it uses mysql_pconnect().
    Indeed the guys from vBulletin support told me to change a variable in config.php in order to turn off persistent connections. The hosting support said the limit is set to 500. Is this the max number of users that may be online at the same time? Because my forum is not that bit, there're only 10-15 users online at any time.
    I changed that setting in vB config.php and we'll see what happens.
     
    siraxi, May 21, 2006 IP
  5. siraxi

    siraxi Peon

    Messages:
    333
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Update: after the webhost increased the max limit of MySQL connections allowed (500) with 10%, the errors keep showing up:
    The webhost support said:
    What should I tell them, which one is the error I'm getting? :confused:

    Thanks!
     
    siraxi, May 22, 2006 IP
  6. Dan Grossman

    Dan Grossman Peon

    Messages:
    177
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That first error means it couldn't connect to the server at all, which isn't due to a connection limit. Most likely the MySQL server had crashed and was offline.
     
    Dan Grossman, May 23, 2006 IP
  7. profs77

    profs77 Well-Known Member

    Messages:
    441
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    118
    #7
    Hi,

    I've also got a issue with MySQL. I'm working on a social networking site.

    Rate My Homie

    What I'm trying to do is related to the LIMIT clause in the SQL query. Trying to SELECT only a certain criteria of users LIMITed starting from a specific row number. But if I do LIMIT 21,1 it returns something from like row 17.

    Its hard to explain and do.
     
    profs77, May 27, 2006 IP
  8. Dan Grossman

    Dan Grossman Peon

    Messages:
    177
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Not possible unless you haven't specified an ORDER BY for the query, or that order changes as new data is inserted.
     
    Dan Grossman, May 28, 2006 IP