Discover Centmin Mod today
Register Now

How To Troubleshoot High CPU Load Issues

Discussion in 'System Administration' started by eva2000, Feb 18, 2022.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    54,548
    12,221
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,790
    Local Time:
    11:16 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    If running Centmin Mod 123.09beta01 or higher, you will have access to a cminfo top command which can also provide a summary of statistics - some of which are explained in info and linked articles below. For more info on the cminfo command available in Centmin Mod 123.09beta01 and newer, see https://community.centminmod.com/threads/cminfo-command-explained.11399/. There's also an accompanying guide for PHP-FPM optimization and troubleshooting.

    FYI, CPU load optimal is 1.0 per cpu thread so 8 cpu thread normal = 8x1 = 8.0. 16 cpu server normal is 16x1 = 16.0

    so cpu load of 8 for
    • 2 cpu server = 8/2 = 4.0 load average
    • 4 cpu server = 8/4 = 2.0 load average
    • 8 cpu server = 8/8 = 1.0 load average
    When you type top command, hit number 1 to break down per cpu stats

    Centmin Mod is provided as is, so troubleshooting load issues is left to end user to do. However, there's many linux tools and scripts that can help you figure out what was causing the load issues and when.

    If you're providing info on this forum, more info might be helpful
    1. What version of Centmin Mod ? .08 stable or .09 beta ? If .09 beta when was it installed and when was last time you updated ?
    2. What's your VPS/Server hardware specifications ? cpu type ? memory available ? disk space ?
    3. Who's your web host ? Different hosts have different limits for server resource usage and some are more restrictive that others so it could just be their resource usage policy you tripped which may or may not be restrictive. If restrictive, then real solution would be finding a better web host. If not restrictive, then it's finding out what caused high cpu load.
    4. If running Centmin Mod 123.09beta01 or higher, you will have access to a cminfo top command which can also provide a summary of statistics - some of which are explained in info and linked articles below.
    Tools and commands you will want to read up on and learn for basic system admin tasks and troubleshooting.
    Notes:
    For example some commands which are also available automatically when you run cminfo top command
    Code (Text):
    top -bn1
    

    Code (Text):
    ps aufxw
    

    Code (Text):
    sar -q
    

    Code (Text):
    sar -r
    

    Code (Text):
    sar -q -f /var/log/sa/sa$(date +%d -d yesterday)
    

    Code (Text):
    sar -r -f /var/log/sa/sa$(date +%d -d yesterday)
    

    If you want to look at per process usage stats use pidstat run pidstat every 1 sec for 5 runs and sed is just to replace your main hostname with word hostname so mask your domain for posting on public places
    Code (Text):
    pidstat -durh 1 5 | sed -e "s|$(hostname)|hostname|g"
    


    Then in Centmin Mod 123.09beta01, you have access to cminfo sar commands for summary stats like
    Code (Text):
    cminfo top
    cminfo sar-cpu
    cminfo sar-mem
    cminfo sar-json
    cminfo sar-cpu-interval
    cminfo phpstats
    


    For posting code you might want to use CODE tags for code How to use forum BBCODE code tags :)


    Important



    Some of the cminfo commands output is sensitive info about your server IP address, location, hostname and domain names as well as database names etc. Usually, this info is for your eyes only for private viewing or sharing with your system admins or hired help. If you do decide to post any output publicly on a forum etc, go through your output and mask any sensitive info with asterisks ***** if need be.
     
Thread Status:
Not open for further replies.