On 11/14/2026 8:55 PM, Lawrence D’Oliveiro wrote:
> On Sat, 14 Nov 2026 19:42:33 -0500, Arne Vajhøj wrote:
>> On 11/14/2026 5:48 PM, Lawrence D’Oliveiro wrote:
>>> What I might also have is separate systemd .service files, one for
>>> running each application,
>>
>> Similar to what the modern PHP servers does.
>>
>> It wastes memory, but provides flexibility.
>
> It’s the only rational way to do it.
>
> PHP servers like PHP-FPM, of course, just transplant the original
> mod_php environment into an isolated process, unchanged. And they use
> creaky old protocols like FastCGI to communicate back to the web
> server. (Heard of anything else that uses FastCGI? I haven’t.)
>
> The approach used by other languages, like NodeJS and Python, is to
> have your app run its own mini-HTTP server, which is “reverse” proxied
> through a “real” web server (Apache, Nginx etc) to the outside world.
> The latter takes care of the tricky stuff like SSL/TLS and virtual
> hosting, and of course helping to keep the bad guys out, while your
> app gets its own event loop, its own ability to run background tasks
> according to its own triggers, and the ability to handle asynchronous
> requests and maintain long-running connections like WebSockets.
FastCGI is old but when it came around then it was an improvement
over CGI. It was used from many languages. PHP may be the best
known, but once upon a time Python was there as well - once upon a
time was before WSGI/ASGI became the standard.
Tomcat -> Spring Boot and IIS -> Kestrel are probably the best examples
of the change from multi-app server to single-app server. You pay with
memory to get independence.
There is also a similar move in the PHP world. From Apache+mod_php,
Apache+FPM, niginx+FPM etc. to FrankenPHP, RoadRunner etc.. And in
some ways it is a double win - you get isolation *and* potentially
better performance. I have recently seen claims that for nginx+FPM
vs FrankenPHP then simple PHP code is same, but Laravel applications
are 3 times faster with FrankenPHP. 3 times faster is worth taking.
It is all about independence and performance. Web sockets in PHP is
not a problem for PHP people. And async background tasks would typical
be handed off to something else via a message queue. Something else may
very likely not be PHP - Java, Python or Go would be likely candidates.
Arne