Welcome! Log In Create A New Profile

Advanced

php-fpm process management

Posted by jayj 
php-fpm process management
May 17, 2011 06:34PM
I know there is an open bug about an alternative way to manage fpm
processes, though I don't know the current state (except that it's
open). However, I don't think the dynamic pool is bad, but it needs a
few tweaks.

First off, the standard apache 'min/max spare servers' concept only
works for heavily loaded servers. I need a system to *slowly* ramp up
and spin down php processes as load increases and decreases throughout
the day. If I set my 'max_spare_servers' too low, my box is
constantly spinning up and then abruptly terminating php processes
because of the bursty nature of my site.

So, what I propose is the following:

a) Modify (if necessary) the load balancing algorithm that fpm uses to
decide which process gets the next request. It shouldn't be 'round-
robin'. It should be a sorted list (I suggest newest-first) of
processes, and each request should go to the first unoccupied process
in the list.

b) Create a 'pm.server_is_spare_after' setting in seconds. Currently
unoccupied servers shouldn't be considered 'spare', only servers that
haven't had a request in a while should be considered 'spare'.

Then just let the min and max spare servers settings do their jobs.
sime
Re: php-fpm process management
May 17, 2011 09:50PM
> First off, the standard apache 'min/max spare servers' concept only
> works for heavily loaded servers.  I need a system to *slowly* ramp up
> and spin down php processes as load increases and decreases throughout
> the day.  If I set my 'max_spare_servers' too low, my box is
> constantly spinning up and then abruptly terminating php processes
> because of the bursty nature of my site.

Can I ask how you are monitoring the creation and termination of PHP
processes?

(Not exactly related to the thread)
Re: php-fpm process management
May 18, 2011 01:28PM
In this case, it was me just using ps and top and seeing the php processes
come and go rapidly.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready