2 ms·
Actually, there is a “fork” mode that outperforms php-fpm by about 100x. That is, it allows the webserver to spawn 100x more processes on the same machine (test
by EGreg 21d ago
Actually, there is a “fork” mode that outperforms php-fpm by about 100x. That is, it allows the webserver to spawn 100x more processes on the same machine (tested) on Linux and Mac. The trick is that the pcntl_fork() is done after loading the classes, so because the OS does copy-on-write of memory pages, each child process takes up maybe 4-200KB. One 4GB machine can handle 40,000 simultaneous users.
This fork mode is exactly for the type of unmofoeid code you’re talking about — which may have some thing not reset between requests. It is still capable of 10-100x more throughout than PHP-FPM, even in its “prefork” mode. This is a “post-fork” if you will.
The code is compatibke with PHP all the way down to 5, so this webserver can be run on any PHP environment from the last 15 years.