Welcome to Centmin Mod Community
Register Now

php-fpm crashing, no swap

Discussion in 'Virtual Private Server (VPS) hosting' started by GASTAN, Jul 7, 2018.

  1. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    My chicagoVPS.net OVZ VPS machine with 1GB ram stops to serve php pages couple of times a day
    I have to restart php-fpm to get php back up running.

    I notices there is no swap file and all the RAM is used normally (when php-fpm is running)

    Code:
    top - 15:07:17 up  9:33,  2 users,  load average: 0.13, 0.16, 0.13
    Tasks:  41 total,   1 running,  40 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.1%us,  0.1%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1048576k total,  1048576k used,        0k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,   669388k cached
    
    so I tried to create swap with:
    swapon /swapfile

    but got "swapon failed: Operation not permitted" error. google says it may be disabled by provide.

    VPS is running 2 Wordpress and one ecomerce sites. I hope 1GB RAM should be ok for the job, but there are no errors in:

    tail -15 /var/log/php-fpm/www-php.error.log
    tail -15 /var/log/php-fpm/www-error.log
    error.log says:
    1600#1600: *2521 connect() failed (111: Connection refused) while connecting to upstream,
    and I cannot find anything in /var/log/messages, cause there is plenty firewall stuff (how to disable that???)

    I upgraded from 123.08 to 123.09beta01 and it seems to be crashing less often, but still :(

    Machine is Censto 6.10(final) 32bit, with updated (no fresh install) 123.09beta01
     
  2. ArisC

    ArisC Active Member

    122
    29
    28
    Jun 1, 2017
    Ratings:
    +59
    Local Time:
    3:12 PM
    Nginx Latest
    MariaDB Latest
    you are not allowed to create or modify even delete the existing swap on OVZ VPS's
     
    Last edited: Jul 7, 2018
  3. eva2000

    eva2000 Administrator Staff Member

    42,077
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    11:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    OpenVZ doesn't support swap creation and you're at mercy of whether or not your VPS provider sets up swap with OpenVZ VPSes out of the box.

    After you update to 123.09beta01 ensure you're on latest 123.09beta01 code by running cmupdate command and recompiling nginx and php-fpm via centmin.sh menu option 4 and 5 and memcached via menu option 10

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches or you can run cmupdate command that was recently added.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch switching via Git backed environment you can setup.

    For 123.08stable that means centmin.sh menu option 23 submenu option 2 (if you previously ran submenu option 1) first, then exit centmin.sh, re-enter /usr/local/src/centminmod and re-run centmin.sh menu.

    For 123.09beta01 and higher that means running SSH command = cmupdate and then re-enter /usr/local/src/centminmod and re-run centmin.sh menu.

    For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    So essentially, you can upgrade from one version branch to another i.e. 123.08stable to 123.09beta01 or higher in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to 123.09beta01 etc configuration, then you would need a fresh OS install and fresh 123.09beta01 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.
     
  4. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    guys at Chicago set 1GB swap for me, once I asked about it via support system.
    I am reupgrading php, nginx and memcached and will report back, see if machine can go week without freezing out on php
     
  5. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    I did menu option 4 and 5 and 10 and since then machine is going strong for 10 days in a row!

    thx
     
  6. eva2000

    eva2000 Administrator Staff Member

    42,077
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    11:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Great to hear :)
     
  7. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    another 13 days and php-fpm is down.
    nginx is still running default static homepage, but none of two WP sites is running anymore :(
    updating nginx to 1.15.2 see how it goes from here
     
  8. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    funny thing is, there are some php processes, but RAM is not used much, not swap

    Code:
    Tasks:  47 total,   1 running,  46 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1048576k total,   312080k used,   736496k free,        0k buffers
    Swap:  1048576k total,   208580k used,   839996k free,    75076k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
        1 root      20   0  2904  580  448 S  0.0  0.1   0:00.19 init
        2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd/58482
        3 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper/58482
      144 root      16  -4  2472  204  200 S  0.0  0.0   0:00.00 udevd
      571 root      20   0 36996 1004  488 S  0.0  0.1   0:07.42 rsyslogd
      608 nsd       20   0  4664  252  228 S  0.0  0.0   0:00.96 nsd
      610 nsd       20   0 11528  148  144 S  0.0  0.0   0:00.00 nsd
      611 nsd       20   0  4864  176  132 S  0.0  0.0   0:00.02 nsd
      704 dbus      20   0  3032  204  200 S  0.0  0.0   0:00.00 dbus-daemon
      712 root      20   0  141m  400  316 S  0.0  0.0   0:24.92 php-fpm
      728 root      20   0  8712  376  300 S  0.0  0.0   0:01.25 sshd
      739 root      20   0  2900  208  204 S  0.0  0.0   0:00.00 xinetd
      752 root      20   0  3052  224  220 S  0.0  0.0   0:00.01 mysqld_safe
     1072 mysql     20   0  442m  18m 1128 S  0.0  1.8  18:37.32 mysqld
     1116 root      20   0  8996  176  172 S  0.0  0.0   0:00.00 saslauthd
     1117 root      20   0  8996   40   36 S  0.0  0.0   0:00.00 saslauthd
     1133 memcache  20   0 12920  676  332 S  0.0  0.1   1:27.67 memcached
     1220 root      20   0 13100  396  320 S  0.0  0.0   0:04.52 master
     1237 postfix   20   0 13340  596  484 S  0.0  0.1   0:01.93 qmgr
     1252 root      20   0  3644  760  396 S  0.0  0.1   0:01.05 crond
     1260 root      20   0  2012  160  156 S  0.0  0.0   0:00.00 mingetty
     1261 root      20   0  2012  160  156 S  0.0  0.0   0:00.00 mingetty
     2476 postfix   20   0 13468  780  544 S  0.0  0.1   0:01.16 tlsmgr
    15176 root      20   0 69580 1472  260 S  0.0  0.1   0:00.00 nginx
    15177 nginx     10 -10 85964 3164  948 S  0.0  0.3   0:10.28 nginx
    15178 nginx     10 -10 85964 2856  972 S  0.0  0.3   0:08.22 nginx
    24477 nginx     20   0  146m  13m  12m S  0.0  1.3   0:00.07 php-fpm
    24483 nginx     20   0  146m  16m  14m S  0.0  1.6   0:00.04 php-fpm
    24490 nginx     20   0  149m  19m  15m S  0.0  1.9   0:00.09 php-fpm
    24503 nginx     20   0  145m  19m  14m S  0.0  1.9   0:00.03 php-fpm
    24504 nginx     20   0  145m  19m  14m S  0.0  1.9   0:00.03 php-fpm
    24710 nginx     20   0  146m  20m  13m S  0.0  2.0   0:00.06 php-fpm
    24871 nginx     20   0  146m  20m  13m S  0.0  2.0   0:00.05 php-fpm
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    42,077
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    11:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what do you mean not running ? error codes ? check error logs
     
  10. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    error log ends at the moment, when php stoped functioning
    (again today:(
    Code:
    tail -15   /var/log/php-fpm/www-error.log
    [02-Aug-2018 14:44:55] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 14:48:15] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 14:58:06] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:04:10] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:06:50] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:12:07] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:19:42] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:25:29] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:29:28] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:30:38] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:34:10] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:34:27] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:37:34] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:43:24] WARNING: [pool www] server reached max_children setting (8), consider raising it
    [02-Aug-2018 15:58:55] WARNING: [pool www] server reached max_children setting (8), consider raising it
    
    
    /var/log/messages is full of this:
    Firewall: *TCP_IN Blocked*

    how can I get rid of it? I can never see anything in messages because of this
     
  11. eva2000

    eva2000 Administrator Staff Member

    42,077
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    11:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  12. GASTAN

    GASTAN Member

    63
    11
    8
    Jun 28, 2017
    Ratings:
    +15
    Local Time:
    2:12 PM
    I'll check it out. even restarting php did not help. I had to restart nginx as well