How to fix php-fpm overloading
Started by huuthi95


Rate this topic
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


0 posts in this topic
huuthi95
Junior Member
**


0
26 posts 21 threads Joined: Jul 2019
27-08-2019, 09:33 -
#1
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:
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:
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:
pm.max_request = 500

now restart the php-fpm using
Code:
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


Forum Jump:


Users browsing this thread: 1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: './lnbhosti_mybb47/mybbi8_threadviews.MYI' (errno: 2 "No such file or directory")
Query:
INSERT INTO mybbi8_threadviews (tid) VALUES('66')