News for hackers. Stuff that matters.
Re:You might not need a WebSocket by Swizec on Thursday July 10, 2014 @12:31PM (#8015552)
> Long-polling gets a bad rap.

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.

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.
Re:You might not need a WebSocket by timmclean on Thursday July 10, 2014 @01:09PM (#8015806)
>> 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.

Re:You might not need a WebSocket by meritt on Thursday July 10, 2014 @01:12PM (#8015827)
Side-note: Apache 2.4 finally has an event-driven mpm. A little late, as nginx rules the web now, but it's still nice to see they finally realized their style didn't scale.