Welcome to Centmin Mod Community
Register Now

Nginx PHP-FPM MariaDB My Website is down sometime

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by huaanhhuy, May 10, 2021.

  1. huaanhhuy

    huaanhhuy New Member

    25
    0
    1
    Jun 10, 2020
    Ratings:
    +1
    Local Time:
    2:45 PM
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed: 1.19.10
    • PHP Version Installed: 7.14.19
    • MariaDB MySQL Version Installed: 10.4.19
    • When was last time updated Centmin Mod code base ? : 1 day ago
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      LETSENCRYPT_DETECT='y'
      RCLONE_ENABLE='y'
      ENABLE_MARIADBTENTWOUPGRADE='y'
      ENABLE_MARIADBTENTHREEUPGRADE='y'
      ENABLE_MARIADBTENFOURUPGRADE='y'
      NGXDYNAMIC_BROTLI='y'
      NGINX_LIBBROTLI='y'
      MARCH_TARGETNATIVE='n'
      

      Post output in CODE tags.
    Hi @eva2000 , I run CMM for my WordPress site on Vultr High Frequency 6$ plan, but sometimes my website down for many hours when I sleep, I have to use 'nprestart' command to restart server, can you guide me how to check the error or fix this problem. Thank you very much

     
  2. eva2000

    eva2000 Administrator Staff Member

    47,008
    10,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,533
    Local Time:
    5:45 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    is nginx down or php-fpm down or both ? Below are guides for cpu load issues, but the commands/log tips are for general troubleshooting too. Unfortunately, you'd be on your own to figure it out using below tools and methods.

    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.

    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 phpstats
    


    For posting code you might want to use CODE tags for code How to use forum BBCODE code tags :) But be careful what you post publicly as sensitive info/names might need masking so look over the output before copying/pasting.