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.

My MYSQL is using up all the ram/cpu

Discussion in 'Workarounds and Optimization' started by Spetsnaz, Oct 6, 2012.

  1. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/server.example.com.err --open-files-limit=20000 --pid-file=/var/lib/mysql/server1.example.com.pid

    Memory is at %10 always and Cpu at %1
    Also
    /usr/local/apache/bin/httpd -k start -DSSL
    I have like 10 of them running
     
  2. srpurdy

    srpurdy Well-Known Member

    Joined:
    Jun 1, 2011
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    based on what your saying those things are all normal.

    httpd always has mutiple processes running. You can tweak this down in WHM -> Apache Configuration -> Global Settings.

    However this may effect performance.

    However You really need to provide more information if your having some sort of an issue with your server.

    Are you having performance issue or is it just that your server is using too much ram? It's possible you may need to add more ram. However if your system is just using a large amount of ram this is normal under linux.

    However if you run a mysqltuner.pl report it may be possible to reduce somethings, but it's probably more likely you'll need to increase mysql ram usage! mysql uses a lot of ram.

    How much memory does your server have and is it a 32 or 64 bit system?
     
    #2 srpurdy, Oct 6, 2012
    Last edited: Oct 6, 2012
  3. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    oh it is because the site loads slow and the cpanel too.
    either not enough ram or cpu?
     
  4. srpurdy

    srpurdy Well-Known Member

    Joined:
    Jun 1, 2011
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hard to say since I got no information to go on.

    But if available ram is low you could end up using a lot of cpu and disk i/o which will slow down cpanel and your sites.

    Do you have high %wa on the CPU ?

    For example the command
    Code:
    top
    
    at the top of this screen you should have something like this.
    Cpu(s): 0.1%us, 0.0%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
     
    #4 srpurdy, Oct 6, 2012
    Last edited: Oct 6, 2012
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You may also want to check your site in this tool:

    Pingdom Tools

    It will show if it is the coding on the site itself that needs changed such as images optimized or external links replaced with internal ones.

    Of note, if you are using suPHP and only have 1 site on the machine, you would be better off switching to either FCGI or DSO + mod_ruid2 instead. suPHP uses less memory but sites under PHP will load slower. For a single site server, there is very little reason to use suPHP unless your machine has low memory such as a VPS.
     
  6. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I am currently using a VPS and I should not use suPHP but instead go with FCGI or DSO?
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    How much RAM does the VPS have?
     
  8. backupgreen

    backupgreen Registered

    Joined:
    Oct 5, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    You may install some caching proxy like nginx.
     
  9. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    @cPanelTristan 2gb
    @Backupgreen - Already have and now I have a problem with 502 gateway
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    2GB should be fine on a VPS to use FCGI or DSO + mod_ruid2. Is the server only really having one site hosted on it? If so, you would probably want to consider using FCGi initially rather than suPHP. FCGI is good for single server sites.
     
Loading...

Share This Page