2 ms·
I also realized recently that PHP-FPM can just prefork a number of processes that equals N x (# of cores). And the OS scheduling and waking up threads on I/O is
by EGreg 4y ago
I also realized recently that PHP-FPM can just prefork a number of processes that equals N x (# of cores). And the OS scheduling and waking up threads on I/O is fast enough that you don't really need evented stuff at all. The advantages are that there are no memory leaks, there is isolation, one hung process doesn't bring down the whole server, and you don't have to rewrite your scripts to worry about sharing a process.
Having said that, if you want to eke out another 3x throughput improvement, then by all means, grab your OpenSwoole or ReactPHP or AMPHP and go to town. But PHP already has Fibers, while OpenSwoole still has coroutines. Oh yeah, and the try/catch in OpenSwoole is broken so good luck catching stuff.
https://twitter.com/openswoole/status/1576948742909198337 https://twitter.com/openswoole/status/1576948742909198337