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.

Too Many Connections!

Discussion in 'General Discussion' started by NetGeek, Mar 10, 2003.

  1. NetGeek

    NetGeek Well-Known Member

    Joined:
    Mar 4, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Hi


    Every day my mysql server is overloaded and all sites on the server have the messege "Too many Connections". I increased the connections up to 800. The problem is less frequent now but it still happened every other day.

    How can I know which user (site) is bounding the MySQL server giving that I narrowed down the time frame when this problem occure during the day.


    TIA
     
  2. mesranet

    mesranet Well-Known Member

    Joined:
    May 6, 2002
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Since i upgrade to latest buildapache and Cpanel 6.0, the high resources its not happen only on cpanellogd, but it was happen too on any mysqld process, sometime it going higher to 90% but average is 15% - 40%, what suppose i do? Is it possible i upgrade by myself to latest mysql 3.23.55 ?

    Please help.
     
  3. AlaskanWolf

    AlaskanWolf Well-Known Member

    Joined:
    Aug 11, 2001
    Messages:
    537
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Fremont CA
    first make sure none of your customers have corrupted data, if so, run the corruption fixer on them in shell or whm

    next enable logs and see who is using the most connections
     
  4. mesranet

    mesranet Well-Known Member

    Joined:
    May 6, 2002
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Hi AlaskanWolf,

    Can you guide me to more detail how to detect and fix corruption on user database, what command suppose i use for it.

    Thanks for help
     
  5. AlaskanWolf

    AlaskanWolf Well-Known Member

    Joined:
    Aug 11, 2001
    Messages:
    537
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Fremont CA
    /etc/rc.d/init.d/chkservd stop
    /etc/rc.d/init.d/mysql stop
    cd /var/lib/mysql
    myisamchk -cs */*.MYI this usually will check all your customers db, silient and report if any are corrupt


    to repair them
    myisamchk -r */*.MYI

    then restart mysql / checkservice

    On some servers, i dont know why but i cant do it the easy way, when checking or repairing under /var/lib/mysql i get a seg fault, so i make up a script and just type out

    cd /var/lib/mysql
    pico check.sh

    #!/bin/bash
    myisamchk -cs a*/*.MYI
    myisamchk -cs b*/*.MYI
    myisamchk -cs c*/*.MYI
    .................and so on....
     
    #5 AlaskanWolf, Mar 14, 2003
    Last edited: Mar 14, 2003
  6. GrimReaper

    GrimReaper Active Member

    Joined:
    Jul 27, 2003
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    The Script

    Just in case anyone has the "to many arguments" problem, here is a script that fixes it, as described in the post above.

    put this into notepad or something, save it and copy it to the server, chmod it 777 (or something executable) and run it in the directory in the post above like ./myscript

    [SNIP] -- <Don't include line.

    #!/bin/bash
    echo Stopping Chkservd
    /etc/rc.d/init.d/chkservd stop
    echo Stopping mySQL
    /etc/rc.d/init.d/mysql stop
    echo Changing Dir
    cd /var/lib/mysql
    echo Checking A
    myisamchk -c a*/*.MYI
    echo Checking B
    myisamchk -c b*/*.MYI
    echo Checking C
    myisamchk -c c*/*.MYI
    echo Checking D
    myisamchk -c d*/*.MYI
    echo Checking E
    myisamchk -c e*/*.MYI
    echo Checking F
    myisamchk -c f*/*.MYI
    echo Checking G
    myisamchk -c g*/*.MYI
    echo Checking H
    myisamchk -c h*/*.MYI
    echo Checking I
    myisamchk -c i*/*.MYI
    echo Checking J
    myisamchk -c j*/*.MYI
    echo Checking K
    myisamchk -c k*/*.MYI
    echo Checking L
    myisamchk -c l*/*.MYI
    echo Checking M
    myisamchk -c m*/*.MYI
    echo Checking N
    myisamchk -c n*/*.MYI
    echo Checking O
    myisamchk -c o*/*.MYI
    echo Checking P
    myisamchk -c p*/*.MYI
    echo Checking Q
    myisamchk -c q*/*.MYI
    echo Checking R
    myisamchk -c r*/*.MYI
    echo Checking S
    myisamchk -c s*/*.MYI
    echo Checking T
    myisamchk -c t*/*.MYI
    echo Checking U
    myisamchk -c u*/*.MYI
    echo Checking V
    myisamchk -c v*/*.MYI
    echo Checking W
    myisamchk -c w*/*.MYI
    echo Checking X
    myisamchk -c x*/*.MYI
    echo Checking Y
    myisamchk -c y*/*.MYI
    echo Checking Z
    myisamchk -c z*/*.MYI
    echo Finished Checking
    echo Fixing...
    echo Fixing A
    myisamchk -r a*/*.MYI
    echo Fixing B
    myisamchk -r b*/*.MYI
    echo Fixing C
    myisamchk -r c*/*.MYI
    echo Fixing D
    myisamchk -r d*/*.MYI
    echo Fixing E
    myisamchk -r e*/*.MYI
    echo Fixing F
    myisamchk -r f*/*.MYI
    echo Fixing G
    myisamchk -r g*/*.MYI
    echo Fixing H
    myisamchk -r h*/*.MYI
    echo Fixing I
    myisamchk -r i*/*.MYI
    echo Fixing J
    myisamchk -r j*/*.MYI
    echo Fixing K
    myisamchk -r k*/*.MYI
    echo Fixing L
    myisamchk -r l*/*.MYI
    echo Fixing M
    myisamchk -r m*/*.MYI
    echo Fixing N
    myisamchk -r n*/*.MYI
    echo Fixing O
    myisamchk -r o*/*.MYI
    echo Fixing P
    myisamchk -r p*/*.MYI
    echo Fixing Q
    myisamchk -r q*/*.MYI
    echo Fixing R
    myisamchk -r r*/*.MYI
    echo Fixing S
    myisamchk -r s*/*.MYI
    echo Fixing T
    myisamchk -r t*/*.MYI
    echo Fixing U
    myisamchk -r u*/*.MYI
    echo Fixing V
    myisamchk -r v*/*.MYI
    echo Fixing W
    myisamchk -r w*/*.MYI
    echo Fixing X
    myisamchk -r x*/*.MYI
    echo Fixing Y
    myisamchk -r y*/*.MYI
    echo Fixing Z
    myisamchk -r z*/*.MYI
    echo Starting Chkservd
    /etc/rc.d/init.d/chkservd start
    echo Starting mySQL
    /etc/rc.d/init.d/mysql restart
    echo Script Finished... Hopefully things work better now
    [SNIP] -- <Don't include line.

    Chris.

    cPanel.net Support Ticket Number:
     
    #6 GrimReaper, Sep 19, 2003
    Last edited: Sep 20, 2003
Loading...

Share This Page