06-08-2019, 03:01 AM
long time not making any tutorial . but i think now is the time
short background . recently my web backend for my android application exploded in popularity and because of that my vps cannot handle it . it starting to give error 500 , 520 , 502 , etc . after some finding i found out the cause to be the php-fpm that limit the processing power and make my site giving that error . i use php for backend simply because i dont know python,nodejs,etc
to fix it edit the www.conf file in /etc/php/{php version}/{apache or fpm(nginx)}/pool.d/www.conf . for example i use php7.0 and nginx so i use
now edit some variable on that www.conf file and find this variable and then change it like this
and then find the pm.max_request and remove the ';'
now restart the php-fpm using
and after that i get the error much less but still slowdown mostly because of the traffic . it not totally fix it for me but enough to be usable . hope you find this tutorial useful
short background . recently my web backend for my android application exploded in popularity and because of that my vps cannot handle it . it starting to give error 500 , 520 , 502 , etc . after some finding i found out the cause to be the php-fpm that limit the processing power and make my site giving that error . i use php for backend simply because i dont know python,nodejs,etc
to fix it edit the www.conf file in /etc/php/{php version}/{apache or fpm(nginx)}/pool.d/www.conf . for example i use php7.0 and nginx so i use
Code: (Select All)
nano /etc/php/7.0/fpm/pool.d/www.conf
now edit some variable on that www.conf file and find this variable and then change it like this
Code: (Select All)
pm = dynamic
pm.max_children = 100
pm.start_servers = 100
pm.min_spare_servers = 25
pm.max_spare_servers = 100
and then find the pm.max_request and remove the ';'
Code: (Select All)
pm.max_request = 500
now restart the php-fpm using
Code: (Select All)
service php7.0-fpm restart (depend on what php version you are using)
and after that i get the error much less but still slowdown mostly because of the traffic . it not totally fix it for me but enough to be usable . hope you find this tutorial useful
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5