MyBB Community Forums

Full Version: VPS help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I've just moved from managed vps (Dreamhost) to unmanged vps (Hostinger) for hosting my website but currently i'm facing one problem... 
after site runs a while i got tons of php-cgi process running and using up all the memory causing stuff to not work.. i.e. mysql getting killed, etc.

root@brainy-boundary:~# free -h
              total        used        free      shared  buff/cache  available
Mem:          1.0G        882M        120K        114M        141M        27M
Swap:          256M        256M          0B
root@brainy-boundary:~# ps -A | grep php-cgi | wc -l
494


I never had this problem while hosting my site on Dreamhost... right now I can only kill these php-cgi when I notice my website is down and I have no clue on how to figure out why i have so many php-cgi process running... any help would be appreciated 

thanks!
Which http server do you use ? apache, nginx, another one ? How is configured the php part of your http server ? And how is configured PHP ?
(2021-12-11, 05:44 PM)Crazycat Wrote: [ -> ]Which http server do you use ? apache, nginx, another one ? How is configured the php part of your http server ? And how is configured PHP ?

using ubuntu with apache
not sure what you mean by 4th and 5th question about php
With WHM/cPanel? Using EasyApache4?
In apache configuration, how are handled the php files ? Usually, it looks like:
<IfModule mod_php7.c>
  php_value include_path ".:/usr/local/lib/php"
  php_admin_flag engine on
</IfModule>

You can also have a look @ pm.max_children value, and all performances settings in apache.

The trouble probably comes from apache which is badly configured and opens too much child processes, or doesn't kill them when they are ended
(2021-12-12, 02:36 PM)HLFadmin Wrote: [ -> ]With WHM/cPanel? Using EasyApache4?

umm webmin

i'm not sure if this is what you are asking about apache

 
apachectl -V
[Sun Dec 12 16:06:10.912953 2021] [so:warn] [pid 1097:tid 139762062199744] AH01574: module proxy_module is already loaded, skipping
[Sun Dec 12 16:06:10.913304 2021] [so:warn] [pid 1097:tid 139762062199744] AH01574: module proxy_fcgi_module is already loaded, skipping
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2021-11-14T23:52:18
Server's Module Magic Number: 20120211:68
Server loaded:  APR 1.6.3, APR-UTIL 1.6.1
Compiled using: APR 1.6.3, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     event
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

(2021-12-12, 03:49 PM)Crazycat Wrote: [ -> ]In apache configuration, how are handled the php files ? Usually, it looks like:
<IfModule mod_php7.c>
  php_value include_path ".:/usr/local/lib/php"
  php_admin_flag engine on
</IfModule>

You can also have a look @ pm.max_children value, and all performances settings in apache.

The trouble probably comes from apache which is badly configured and opens too much child processes, or doesn't kill them when they are ended

hi thx since yesterday i have followed this guide
https://www.linode.com/docs/guides/how-t...ntu-18-04/
now i'm monitoring to see if it'll solve the problem (fingers crossed)

<IfModule mod_fcgid.c>
  FcgidConnectTimeout 20
  AddType  application/x-httpd-php         .php
  AddHandler application/x-httpd-php .php
  Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
  <IfModule mod_mime.c>
    AddHandler fcgid-script .fcgi
  </IfModule>
</IfModule>

but i think it was

<IfModule mod_fcgid.c>
  FcgidConnectTimeout 20
  <IfModule mod_mime.c>
    AddHandler fcgid-script .fcgi
  </IfModule>
</IfModule>

whereabout can i see this pm.max_children?
any other stuff would you need to look at?
sorry i'm a noob at linux, web development, administration, etc..
any help is appreciated


--- edit ---

aww sorry i thought you wanted to <IfModule mod_fcgid.c>
where is <IfModule mod_php7.c> located so i can show you how it is right now