Description
Description
I'm writing an "external" multiplatform php fastcgi process manager in golang for the caddy webserver, something like php-fpm but using the php-cgi executable in fastcgi mode;
while implementing it using socket passing to be faster simpler and have zero-copy between processes
i've found that i wanted to add an option in my process manager analogous to php-fpm pm.process_idle_timeout to free memory when the server load is low and to avoid eventual memory leaks
I've thinked about how to implement this feature for a while in a way that does not require modifying php-cgi itself, but without finding a solution that allowed to keeping zero-copy socket passing.
The proposal is to add an environment variabile option that instruct php-cgi processes to self terminate after a certain amount of time if no requests are received, something like the already existing PHP_FCGI_MAX_REQUESTS that already aligns with php-fpm pm.max_requests.
Eventually having millisecond granularity unlike second granularity only like in pm.process_idle_timeout will be a plus.
That Is... Hoping i'm not missing something obviuos and that the proposal make sense.