The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysql - Too many connections

Discussion in 'General Discussion' started by ialex03, Nov 12, 2004.

  1. ialex03

    ialex03 Well-Known Member

    Joined:
    May 15, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello.

    We are getting "too many connections" from mysql quite often. We have max_connections=500 and there are not more then 20 connections used all the time.
    But something happens and oops! - all 500 are used.

    I cannot check what script causes this because mysql won't let me in when 500 connections are busy. Although the mysql documentation says this:

    the root mysql user have the "super" privilege but it cannot connect anyway.

    Does somebody know why it happens and how I can get a list of mysql processes when "too many open connection" ?

    Thank you.
     
  2. vortex2000

    vortex2000 Member
    PartnerNOC

    Joined:
    Apr 21, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Same Problem

    I have the same problem, only it's on a PLESK machine.
     
  3. jester.ro

    jester.ro Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2004
    Messages:
    304
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    that 500 max_connection setting is from my.cnf or from php.ini?

    check the number in both files. the one in php.ini shoul be smaller that the one from my.cnf

    also check the number of persistent connections in php.ini(if you allow them)


    i have a server doing mostly mysql (70-80% CPU used allways) and i have 100 persistent and 400 total in php.ini, and 450 max_connections in my.cnf. And i've never reached that limit. (usually all 100 peristent + 150-250 non-persistent)
     
  4. ialex03

    ialex03 Well-Known Member

    Joined:
    May 15, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    php.ini has nothing to do with it because I cannot log in to mysql from the command line under "root" user.

    So does somebody know how to get the "reserved connection" working actually?
    I really need to have ability to log in and check connections when all mysql connections are busy.

    Thank you.
     
  5. LordJMann

    LordJMann Well-Known Member

    Joined:
    Jun 15, 2003
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Too many connections is because of improperly configured scripts that do not close connections after being used, therefore they are left open, I have SOLVED this issue by CLOSING the MySQL connection at the end of every script. Either this or you have a quite alot of MySQL using on your server.
     
  6. iko

    iko Well-Known Member
    PartnerNOC

    Joined:
    Jan 29, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Yeah but you haven't answered the actual question which was: "Why the 1 reserved connection doesn't work?"

    I wonder the same.
     
Loading...

Share This Page