News for hackers. Stuff that matters.
Re:600k concurrent websocket connections on AWS using Node.j... by Thaxll on Friday October 11, 2019 @09:45AM (#21224268)
If you have a lot of trafic you shoudn't use an ELB in the first place, should be using an NLB by default it comes with a 40Gb pipe and multi millions connections.

https://docs.aws.amazon.com/elasticloadbalancing/latest/netw...

Re:600k concurrent websocket connections on AWS using Node.j... by windlep on Friday October 11, 2019 @11:35AM (#21225369)
We did not use an NLB because it is expensive in its pricing model for TLS connections (and we prefer to let AWS terminate TLS). For 20 million connections, an NLB would cost $28,800/month. It's drastically cheaper to use an ELB, provided you can talk to AWS to have them scale it for you.
Re:600k concurrent websocket connections on AWS using Node.j... by mnutt on Friday October 11, 2019 @04:21PM (#21228095)
When I last discussed this with AWS, having them scale it for you meant that you actually had to contact them to pre-warm the ELB whenever you expected more traffic. It didn't work for our use cases where we didn't know when to expect more traffic.
Re:600k concurrent websocket connections on AWS using Node.j... by windlep on Saturday October 12, 2019 @12:10AM (#21230616)
Yup, that hasn't changed in our experience. If you're looking at bursty traffic beyond what AWS will pre-warm for you, then this likely won't work. We have fairly consistent loads throughout the day.
Re:600k concurrent websocket connections on AWS using Node.j... by papito on Friday October 11, 2019 @02:27PM (#21227027)
Back in the day, in my first job, I created load balancing using LVS. It was not easy to set up, compared to AWS, but it worked, and it was completely free, plus some man-hours up front. I wonder if it would be worth it nowadays...
Re:600k concurrent websocket connections on AWS using Node.j... by xyzzy_plugh on Friday October 11, 2019 @03:36PM (#21227678)
Is it drastically cheaper to use an NLB without letting AWS terminate TLS? I thought AWS was expensive for TLS termination, generally, unless you need the client locality for lower latency.
Re:600k concurrent websocket connections on AWS using Node.j... by windlep on Saturday October 12, 2019 @12:08AM (#21230611)
Yes, if you terminate TLS its drastically cheaper. Without TLS, each NLB unit lets you have 100,000 concurrent connections. With TLS, a single unit is 3,000 connections. Similar pricing occurs with ALB's.

Terminating TLS yourself incurs some CPU cost and a bit more memory cost. How much CPU/memory is eaten depends on the efficiency of your code. Our Rust implementation roughly matches C code efficiency, so we could handle terminating TLS ourselves if ELB stops being feasible at some point.

Re:600k concurrent websocket connections on AWS using Node.j... by arrty88 on Friday October 11, 2019 @09:59AM (#21224403)
You can also employ DNS round robin with health checks in Route53
Re:600k concurrent websocket connections on AWS using Node.j... by Thaxll on Friday October 11, 2019 @10:13AM (#21224533)
ELB is pretty old and should be avoided tbh, use ALB and if you can't should switch to NLB ( for pure tcp LB ).
Re:600k concurrent websocket connections on AWS using Node.j... by windlep on Friday October 11, 2019 @12:05PM (#21225669)
Same issue as NLB, they charge for units based on concurrent connections and it gets very expensive very quickly.
Re:600k concurrent websocket connections on AWS using Node.j... by song on Friday October 11, 2019 @01:03PM (#21226234)
DNS round robin has the disadvantage of not guaranteeing that the traffic will be equally distributed. This can be a problem if there's a lot of automated traffic.

But, with that said, in term of price, it's unbeatable.

Re:600k concurrent websocket connections on AWS using Node.j... by arrty88 on Saturday October 12, 2019 @11:30AM (#21233892)
I have had success DNS round robin-ing a cluster of HAproxy LBs which handle SSL and then proxy to my backend websocket gateways which keeps the real load evenly distributed where it matters and also run health checks on the nodes.
Re:600k concurrent websocket connections on AWS using Node.j... by sieabahlpark on Friday October 11, 2019 @02:34PM (#21227083)
The point is at scale you can't guarantee equal but something around there
Re:600k concurrent websocket connections on AWS using Node.j... by song on Friday October 11, 2019 @11:21PM (#21230429)
That works well, but if you do ecommerce or a web app for which people write a lot of bots, then the traffic won't necessarily be that well distributed (mostly because users while run bots out of dedicated servers or such and will tend to only query dns once).

A bit of an edge case but pretty much the only issue I've had so far which is why I bring it up.

Re:600k concurrent websocket connections on AWS using Node.j... by nathancahill on Friday October 11, 2019 @10:10AM (#21224513)
That's the first tool I grab for balancing _a lot_ of connections.