Hacker News new | ask | show | jobs
by FpUser 2082 days ago
So we've just rediscovered stateful web applications. Been doing those since early 90's and still doing it now (well among lots of other things). The difference for me is that I've never went for FastCGI. I would instead embed HTTP server in the application itself. In the beginning when the whole concept was young said server would face the outside world directly, now it is hiding behind reverse proxies like Nginx.
1 comments

The issue with that to me is the concern of memory leaks. With PHP/FastCGI, it's not a problem because after every request, the memory is thrown away. You just need to trust that PHP-FPM itself doesn't leak.

But that said, I do use https://reactphp.org/ occasionally for certain types of tasks (like running a websocket server) and that works great too, but it takes extra care to make sure not to use blocking IO and to take more care of memory management.

Modern C++ greatly simplifies the situation with the memory (unless you specifically want to play with with it). My latest code for server application contains exactly zero explicit de-/allocations.