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 connection not dropping

Discussion in 'General Discussion' started by sexy_guy, Jul 25, 2003.

  1. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Im using Shauns Watchmysql program to monitor the number of mysql connections open by our users. Squirrelmail is using a Mysql database to store our user prefs. Since recompiling the entire box and upgrading to 1.3.28 i have received numerous emails from watchmysql thats telling me that the squirrelmail user has opened 12 connections. I get these messages every hour, but it seems mysql is not dropping the connections. :confused:

    cPanel.net Support Ticket Number:
     
  2. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    ** BUMP **

    I had 137 mysql dbs open tonight on one box with 50 sites on it? WHY? Why is mysql not dropping the connections? Since upgrading to 1.3.28 we have had nothing but problem with Mysql sessions. Please fix this problem!

    cPanel.net Support Ticket Number:
     
  3. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Although I'm not sure about the SquirrelMail situation, I do know that open mySQL connections seem to be a fact of life. Running Apache 1.3.27 and no SM processes, I usually have 60 - 80 open connections. This is due to the PHP coding itself. Best way I've found for solving this "too many open mySQL connections" problem is to simply restart mySQL. How many times a day this is done depends on how many processes are left open.

    cPanel.net Support Ticket Number:
     
  4. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    In my.cnf if you have it to drop very early there should be no reason why the connections should stay open. We had one site alone at 85 connections today and there are 250 sites on this one box.

    cPanel.net Support Ticket Number:
     
  5. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Have you tried turning persistent connections off in the php.ini?

    cPanel.net Support Ticket Number:
     
  6. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    I have a script that i in the background and reports excessive mysql conections based on the user or site that is opening them. Yesterday i saw this all day.

    Sat Aug 2 14:41:23 PDT 2003


    2:41pm up 5 days, 1:11, 1 user, load average: 0.95, 0.66, 0.48
    147 processes: 144 sleeping, 3 running, 0 zombie, 0 stopped
    Mem: 1031244K av, 867624K used, 163620K free, 0K shrd, 77552K buff
    Swap: 1024120K av, 64012K used, 960108K free 521024K cached

    PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
    31093 nobody 15 0 1088 1084 816 R 5.5 0.1 0:00 top
    30412 nobody 15 0 17976 17M 17240 R 0.0 1.7 0:00 httpd


    Http processes currently running = 37
    Mysql processes currently running = 137 <===== HERE

    Netstat information summary
    4 LAST_ACK
    15 TIME_WAIT
    40 LISTEN
    41 ESTABLISHED

    This morning it was the same old thing, 137. Then i turned persistent_connection to off but im not sure that this is the answer. After turning it off i see

    Http processes currently running = 44
    Mysql processes currently running = 13

    Which is about right.

    Ever since we upgraded to Apache 1.3.28 the number of open mysql connections have sky rocketed. This is not normal.

    wait_timout, interactive_timout are set very low yet these connections are not dropping. Either this is a mysql bug or a cpanel issue. All i can say is that this is not happening on our 1.3.27 boxes.

    cPanel.net Support Ticket Number:
     
    #6 sexy_guy, Aug 2, 2003
    Last edited: Aug 2, 2003
  7. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    Thank goodness it's not just me. I have 6 boxs and 2 of them are RHEL band new boxes one has 6 sites on it and one with 55. Top shows 190 running processes, I kill and restart mysqld and it drops to 98 - 100 instantly. ps reports the same results. Funny thing is all of these sites were on other RH7.3 and RH9 boxes and they were packed with sites and doing like 300GB month and never did I see loads and that # of open mysqls.
     
  8. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    In my case I been using 1.3.31 on all my boxes since nick put out the buildapache.sea.
     
Loading...

Share This Page