3 ms·
> 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
by Swizec 12y ago
> 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.
- plorkyeran 12y agoModern setups don't even involve spawning a new thread per request anymore as even that doesn't scale well enough.
- timmclean 12y ago>> 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.
- meritt 12y agoSide-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.