3 ms·
Whether the opcache is enabled or not, the vast majority of production PHP code is I/O bound - workers wait for the network or filesystem or database. Roadrunn
by EGreg 14d ago
Whether the opcache is enabled or not, the vast majority of production PHP code is I/O bound - workers wait for the network or filesystem or database.
Roadrunner, FrankenPHP and Swoole try to make it evented like Node, but require you to rewrite all your code to use their libraries. For everything from mysql to curl.
This lets you run your PHP unmodified, in 2 different ways:
1) with long persistent workers, clearing all statics and globals between requests
2) if that doesn’t work, eg because your functions have static variables inside etc. then you can use the fork mode, which can still handle 100x as many users as php-fpm due to the amount of RAM each of the workers takes up aa that’s the point!