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.