4 ms·
Is it possible to write long-running processes well in PHP today? Is the memory management of PHP up to the task? Or is it all a *cgi-based execution model? Thi
by 2ion 6y ago
Is it possible to write long-running processes well in PHP today? Is the memory management of PHP up to the task? Or is it all a *cgi-based execution model? This question still is what makes it hard to place PHP. Basically all "high perf"/"high load" applications of it I know about run under PHP-FPM or webserver modules or uwsgi.
- AegirLeet 6y agoLong-running processes are definitely possible. You obviously have to be a bit more careful not to leak memory. It's common to have things like queue workers implemented as long-running CLI processes. I just checked one of our services at work and there's a queue process that has been running for more than 4 months. There might be others that have been running even longer, but I don't feel like checking every service right now ;) Projects like Swoole or ReactPHP are trying to make similar things possible for serving web requests too.