Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Every problem you just listed is 100% in your control and able to be configured, so the issue isn't long polling, it's your setup/configs. If your client (libcurl) times out a request, set the timeout higher. If apache is your web server and it disconnects idle clients, increase the timeout, tell it not to buffer the request and to pass it straight back to the app server. If there's a cloud lb somewhere (sounds like it because alb defaults to a 10s idle timeout), increase the timeouts...

Every timeout in every hop of the chain is within your control to configure. Setup a subdomain and send long polling requests through that so the timeouts can be set higher and not impact regular http requests or open yourself up to slow client ddos.

Why would you try to do long polling and not configure your request chain to be able to handle them without killing idle connections? The problems you have only exist because you're allowing them to exist. Set your idle timeouts higher. Send keepalives more often. Tell your web servers to not do request buffering, etc.

All of that is extremely easy to test and verify functioanlity. Does the request live longer than your polling interval? Yes? Great you're done! No? Tune some more timeouts and log the request chain everywhere you can until you know where the problems lie. Knock them out one by one going back to the origin until you get what you want.

Long polling is easy to get right from an operations perspective.



Whilst it's possible you may be correct, I do have to point out you are, I believe, lecturing John Nagle, known for Nagle's algorithm, used in most TCP stacks in the world.


He has a valid criticism. It's not that it can't be fixed. It's that it's hard to diagnose.

The underlying problems are those of legacy software. People long gone from Linden Lab wrote this part of Second Life. The networking system predates the widespread use of middle boxes. (It also predates the invention of conflict-free replicated data types, which would have helped some higher level consistency problems.) The internal diagnostic tools are not very helpful. The problem manifests itself as errors in the presentation of a virtual world, far from the network layer. What looked like trouble at the higher levels turned to be, at least partially, trouble at the network layer.

The developer who has to fix this wrote "This made me look into this part of the protocol design and I wish I hadn't."

More than you ever wanted to know about this: [1] That discussion involves developers of four different clients, some of which talk to two different servers.

(All this, by the way, is part of why there are very few big, seamless, high-detail metaverses. Despite all the money spent during the brief metaverse boom, nobody actually shipped a good one. There are some hard technical problems seen nowhere else. Somehow I seem to end up in areas like that.)

[1] https://community.secondlife.com/forums/topic/503010-obscure...


> Whilst it's possible you may be correct, I do have to point out you are, I believe, lecturing John Nagle, known for Nagle's algorithm, used in most TCP stacks in the world.

Thank you for pointing that out. This thread alone is bound to become a meme.


[flagged]


I'm sorry, I didn't mean to embarrass you. I only meant to point out that people would err on the side of John likely knowing what they were talking about, whilst you seem to confidently have some misunderstandings in your comment.

For example, you said "Every timeout in every hop of the chain is within your control to configure", but I'm quite confident that the WiFi router my office uses doesn't respect timeouts correctly, nor does my Phone's ISP, or certain VPNs. Those "hops" in the network are not within my control at all.


> I better go kill myself from this embarrassment so my family doesn't have to live with my shame!

There's no need to go to extremes, no matter how embarrassing and notably laughable your comment was. I'd say enjoy your fame.


> There's no need to go to extremes

Agreed, honestly if an argument is made and it makes sense, it doesn't matter who is on the other side.

> no matter how embarrassing and notably laughable your comment was.

I wouldn't even call the original comment laughable, they had a point - if you are in control of significant parts of the overall solution, then you can most likely mitigate most of the issues. And, while not a best practice, there's nothing really preventing you from sneaking in the occasional keepalive type response in the stream of events, if you deem it necessary.

The less of the infrastructure and application you control, the more likely the other issues are likely to pop up their heads. As usual, it depends on your circumstances and both the original comment and the response are valid in their own right. The "extreme" response was a bit more... I'm not sure, cringe? Oh well.


I bet there's an online college credit transfer program that'll accept this as a doctoral defense. Depending on how Nagle's finagled.


Oh my gosh :-D


[flagged]


But it's easier to lecture someone on a bug they already diagnosed and explained to you.


We must be reading different comments


> Every timeout in every hop of the chain is within your control to configure.

lol


I wasn't talking about network switch hops and if you're trying to long polling and don't have control over the web servers going back to your systems then wtf are you trying to do long polling for anyway.

I don't try to run red lights because I don't have control over the lights on the road.


Thus, the advice to not run the red light..


[flagged]


Re-read the post, there’s more in the path than just your client and server code, and network switches aren’t the problem. The “middle boxes and proxy servers” are legion and you can only mitigate their presence.

You’ve been offered the gift of wisdom. It’d be wise on your part to pay attention, because you clearly aren’t.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: