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.

constant mysql connection issues?

Discussion in 'Database Discussions' started by fkatzenb, Apr 9, 2010.

  1. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    I have been noticing that MySQL disconnects one a periodic basis. Of course I primarily notice through the email notices from my CB forums. But that means people are being directed to the error page. Not something I like to see. Suggestions?
     
  2. Janak

    Janak Well-Known Member

    Joined:
    Jul 18, 2009
    Messages:
    71
    Likes Received:
    1
    Trophy Points:
    6
    You would get better idea from MySQL logs

    /var/log/myslqd.log
     
  3. WiredTree Joe

    WiredTree Joe Well-Known Member
    PartnerNOC

    Joined:
    Dec 13, 2006
    Messages:
    68
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Chicago, IL
    Most forum software can report the exact error being given, but you might be hitting your mySQL max connections. Check your /etc/my.cnf for low values on:

    Code:
    max_user_connections=25
    max_connections=300
    
    Very active forums can use a lot of connection slots under high concurrent usage. Raising those values and restarting mySQL is a good thing to try out. Don't raise them too high as those limits are in place for a reason. Setting them too high can run you out of server resources very quickly. Without knowing the exact error this is no more than a guess at the cause of the issue, but it might point you in the right direction.
     
  4. MaestriaNick

    MaestriaNick Well-Known Member

    Joined:
    Aug 6, 2008
    Messages:
    159
    Likes Received:
    3
    Trophy Points:
    18
    This is most likely due to the script not closing connections to mysql properly or is getting too busy at times. There is a 25 (max_user_connections) concurrent mysql connection limit which is good for around 100 simultaneous visits on well written scripts. If a script is keeping connections open then obviously 25 concurrent connections do not go far and some of your visitors would see an error.
     
  5. xerophyte

    xerophyte Well-Known Member

    Joined:
    Mar 16, 2003
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    Install munin and mysql plugin to monitor the mysql server and get stats out of it. Then try to make a decision from the graphs. You can also try tunning-primer.sh to get draft idea about your mysql system variables setting .. hope that helps
     
  6. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Thanks for the info. Outside of those random notices, there has been no degraded performance. I did find in the log that eximstat/smtp was corrupted. I repaired that and I haven't received another notice. I will keep watching. I just wished logwatch would monitor mysql.

    Thanks,
    Frank
     
Loading...

Share This Page