Live data from Hacker News

Everybody gets WebSockets

blog.cloudflare.com

71–78 of 78 posts

Re: Everybody gets WebSockets

#71
post #70
post #42

Neat. We've been using CF websockets for some time now on the Enterprise plan. If you're intending to use CF websockets, be prepared for random (and potentially massive) connection drops, and be sure you're architected to handle these disconnects gracefully. Cloudflare rolling restarts have caused hundreds of thousands of websocket connections to be disconnected in a matter of minutes for us. If you plan to operate a…

As you know, when terminating a WebSocket connection due to releases CloudFlare now signals this action to both client and origin server by sending the 1001 status code (aka "going away", see section 7.4.1 of RFC 6455), so both sides are aware that the WebSocket termination is only a transient event, and that they can expect to immediately re-establish a connection again on retry. We're working on additional refineme…

Aye! Well aware. I actually think you added that for us specifically! Anyways, it's worth noting for anyone interested that they'll need to be able to handle spikey reconnects.

In our case, we keep a buffer of the last N websocket messages sent to the client, and when the client reconnects, it sends the last sequence id that the client saw, and the server catches it up.

https://discordapp.com/developers/docs/topics/gateway#resumi...

Re: Everybody gets WebSockets

#72
Anyone else watch the video and notice all the falsehoods?

Allegedly, previous to WS, the only alternatives were flash and polling! Except that long-polling isn't really polling in any meaningful sense (they very clearly describe polling that isn't so-called long-polling), and in particular doesn't have the latency-vs-bandwidth tradeoff and impact that actual polling has.

Allegedly, WS are "exponentially more efficient"! Except that they're not, they're more efficient by a constant factor.

Allegedly, the range of bandwidth saving is 99.8% to 99.9%! Except that obviously if you're passing enough data around in few enough responses, the bandwith savings could be more like 5% or 10%, and I find it hard to believe that typical uses actually save over 50%.

I sure do think web sockets are sweet, but wouldn't it be nice if there was some way to hold liars accountable?

Re: Everybody gets WebSockets

#75
post #46

Earlier quoted context omitted.

> Knowing all the hashes of my machines means I can then use all my machines as a computing cloud. went looking through your github and blog for some code andor a writeup any plans to post? god of magic :p

Yeah, I was making some big changes on my blog, and things kind of exploded in my face. My fault, it wasn't terribly critical so I nuked and reinstalled. Just install Tor as you normally would, and turn on Hidden Services from port 22 to port 22 (for SSH). Keep track of the generated Tor onion hostname when you restart with Hidden Services enabled. ______________________________________ But here's the 'magic' part ho…

thanks for the quick write up, i'll have to take a weekend to play with it

god of magic form: https://upload.wikimedia.org/wikipedia/en/thumb/2/2a/Angelke...

Re: Everybody gets WebSockets

#76
post #38
post #29

I get that the overhead of an individual message over an individual connection is lower, but for that efficiency you give up layer 7 routing capability, make load balancing difficult, have more long-lived connections to your servers. Does HN generally feel like these are worthwhile tradeoffs?

Absolutely yes. Connections are very very cheap to maintain, and very very expensive to build up and break down. Even in environments with load balancers, stateful firewalls, etc., it is much easier to keep a socket open than it is to create a new one. If you're doing any kind of realtime data, websockets are the way to go. It is way, way easier to do stream processing and deal with backpressure than it is to have a…

How is that better than HTTP with keep-alive. With that approach you also have long standing connection, but when connection is broken it'll be reestablished seamlessly.

Re: Everybody gets WebSockets

#78
post #46

Earlier quoted context omitted.

Yeah, I was making some big changes on my blog, and things kind of exploded in my face. My fault, it wasn't terribly critical so I nuked and reinstalled. Just install Tor as you normally would, and turn on Hidden Services from port 22 to port 22 (for SSH). Keep track of the generated Tor onion hostname when you restart with Hidden Services enabled. ______________________________________ But here's the 'magic' part ho…

thanks for the quick write up, i'll have to take a weekend to play with it god of magic form: https://upload.wikimedia.org/wikipedia/en/thumb/2/2a/Angelke...

I certainly have the laugh :)

And was really, one of the best villains I've ever seen in any game/movie. Intentionally poisoning everyone, for expediency, is disgustingly evil.

Post reply on HN