Hacker News new | ask | show | jobs
by hu3 1523 days ago
If anything the NodeJs model is trickier to scale because it requires discipline to never block the loop unnecessarily.

PHP/Go/C# one-thread-per-HTTP-request also requires less cognitive load where everything is synchronous by default. Also PHP's throw-away-everything after each request tolerates much more junior-code abuse.

Forgot to close a database connection or transaction? No problem, PHP will do that for you. Left a file open? Forgot to close a CURL handle? No worriers the janitor is coming to clean your mess at the end of the request.

With that said, PHP does have an event loop. See ReactPHP and Swoole. They existed for years and while they have their uses, they aren't going to overtake "standard" PHP execution model anytime soon partly because of the reasons above.