3 ms·
> "One request = one freshly started process" This isn't true for all (most?) PHP applications today. PHP installations include the FastCGI Process Manager (ph
by InformalAnybody 3y ago
> "One request = one freshly started process"
This isn't true for all (most?) PHP applications today. PHP installations include the FastCGI Process Manager (php-fpm). According to Wikipedia (https://en.wikipedia.org/wiki/FastCGI https://en.wikipedia.org/wiki/FastCGI),
> Instead of creating a new process for each request, FastCGI uses persistent processes to handle a series of requests.
According to the PHP Internals book (https://www.phpinternalsbook.com/php7/memory_management/zend_memory_manager.html#the-two-main-kind-of-dynamic-memory-pools-in-php https://www.phpinternalsbook.com/php7/memory_management/zend...), is close to a "share-nothing architecture" thanks to custom implementations of `malloc()` and `free()` that know about the lifecycle of a request.
- hu3 3y agoIt depends on the configuration. One can set pm.max-requests=1 and have the process respawn per request. https://www.php.net/manual/en/install.fpm.configuration.php#pm.max-requests https://www.php.net/manual/en/install.fpm.configuration.php#... And the main point still stands: If a request manages to crash a php-fpm child process, other requests are unaffected and another process is spawned to replace the crashed one.