Daemons in PHP. WebSocket
How bad is PHP at this and why? I read on various forums that PHP does not cope well with WebSocket, they say the server often crashes, a large load, poor optimization, php is not suitable for this use node.js, and here's why no one writes, I want to know why and in general whether it's true, tell me.
For example, the task is to write a chat with an attendance of 100 people. on websocket, does php handle these worse than node.js?
2 answers
Anything can handle 100 connections. See example https://habrahabr.ru/post/351012/
There is an ideological flaw in php for this, and it is revealed in the article https://habrahabr.ru/post/179399/ . "PHP was created to die" and there are no such advanced garbage collectors as in java, parallel programming is only available with" crutches " like ReatPHP.
PHP is not designed to hold state. If you force it to do this, it will flow from memory.
The best solution is to implement a WebSocket server on node.js, but in the case of 100 users, it will be easier to use a third-party solution like https://cloudws.io
But you also need to consider how much confidential information is transmitted there, because even though they write on the site that they do not store messages, but who knows