"I got 99 warnings, but a bug ain't one."


I found the ECS server always has high memory load these days because too many php-fpm were started.

When I entered ps -ef, I found php5 is still running which is quite strange.

In order to reduce memory load down to 70% or lower, I’m going to reset some variables in php-fpm.conf

/www/server/php/71/etc/php-fpm.conf #the root directory was changed because of bt panel, which will be abandoned this in next generation of website

Using vim to edit it (tips for vim: I for insert, ESC for quit editing, : for enter command wq for save/quit, q for quit)

Well, I just tune a little bit in config file to adjust my low permanence ecs server.

For more configuration tips, you can visit here

This is my config file:

listen = /tmp/php-cgi-71.sock
listen.backlog = 8192
listen.allowed_clients =
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.status_path = /phpfpm_71_status
pm.max_children = 20 #default is 50
pm.start_servers = 5
pm.min_spare_servers = 2	#default is 5
pm.max_spare_servers = 10
request_terminate_timeout = 100
request_slowlog_timeout = 30
slowlog = var/log/slow.log

Ok, then we can restart php-fpm

/www/server/php/71/etc/init.d/php-fpm restart
/www/server/php/71/etc/init.d/php-fpm start
/www/server/php/71/etc/init.d/php-fpm stop


0 0 vote
Article Rating
0 评论
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x