I’m running lighttpd 1.4.80 with PHP via FastCGI (php-cgi, not php-fpm).
The page Optimizing FastCGI performance says:
there is a potential race condition during the PHP cleanup code in which PHP can be shutting down but still have the socket open, so lighty can send request number 501 to PHP and have it "accepted", but then PHP appears to simply exit, causing a 500 return from lighty.
To limit this occurance, setPHP_FCGI_MAX_REQUESTSto 500.
From what I understand, this is about php-cgi exiting after handling PHP_FCGI_MAX_REQUESTS requests, and a race condition when the webserver sends another request just as PHP is shutting down.
Does this race condition still apply with current PHP versions (e.g. PHP 8.x) when using php-cgi with lighttpd 1.4.80?
Environment:
lighttpd 1.4.80
PHP 8.4
using php-cgi directly (FastCGI backends spawned by lighttpd)
I’m trying to understand whether the docs are describing a historical bug, or whether I still need to tune this setting today.