Re:You might not need a WebSocket
by plorkyeran on Thursday July 10, 2014 @12:58PM
(#8015727)
Modern setups don't even involve spawning a new thread per request anymore as even that doesn't scale well enough.
>> most servers don't make a new process for every request anymore
That's correct. Most designs use either a prefork model (e.g. Apache) or an asynchronous event-driven model (e.g. Nginx). With prefork, a number of worker threads or processes are created on start up, and each services one request at a time. In the asynchronous model, a smaller number of (typically single-threaded) processes are created on start up, and each services one event at a time. An event could be an incoming request, a database query returning, etc. In either model, thread/process creation typically happens entirely on start up.
Yes it does, but not for the reasons you mentioned. The main objection against long-polling in the olden days was that it would spin up a new server process every time, leading to server overload. Websockets solved this by allowing a single server to handle multiple connections on the same socket.
However, these days that is arguably not the case anymore. I think most servers don't make a new process for every request anymore, but I could be wrong. Am I wrong?
Regardless, long-polling has left a sour taste in people's mouths and now they've moved on.
But I agree, websockets are overkill for most cases and I have personally never found them to be a very reliable piece of technology. They're super fragile and finnicky and I never liked working with them.