Hacker News new | ask | show | jobs
by kaba0 1062 days ago
But websockets are quite expensive and requires huge server resources, aren’t they? Notably, lemmy instances can barely handle 1000s of people even when it is written in Rust because they (dumbly) decided to use websockets, when a forum absolutely doesn’t need it, and is more than fine with only approximately real-time data.

Don’t get me wrong, I don’t claim anything general with this, of course WebSockets have their uses and I’m sure Electric Clojure uses them more responsibly, it really is more of a question on what do you think of it. Elixir also has WebSocket solutions, so it seems to be a more common solution nowadays.

1 comments

LiveView at 2 million clients on 40core/128gb box, limited by ulimit: https://www.phoenixframework.org/blog/the-road-to-2-million-...

discord uses websockets, here are some more links: https://www.reddit.com/r/elixir/comments/pophiz/server_specs...

we'll have seamless reconnect soon, which means the ws connections can actually drop when inactive (no heartbeats!) and then reconnect when the client wants something, so the forum use case should be quite fine. Not everything needs to be realtime server push, so refactor your code so that queries run on page nav or something. Electric is network transparent but that doesn't mean the network is opaque, the reactivity graph is in userland control (as declared by your AST) and the network data flow is implied by that same AST, same reactivity graph!

It makes sense for a real time chat program, especially with voice chat. Not really for a mostly-static, reddit-like client.