Hacker News new | past | comments | ask | show | jobs | submit login
Soketi: Simple, fast and resilient open-source WebSockets server (soketi.app)
124 points by rakibtg on Aug 25, 2022 | hide | past | favorite | 38 comments



> Stop paying for €xpen$ive realtime

First time I've seen what appears to be a purely free project going on the offense against SaaS providers, complete with a mock pricing table. I wonder what the motivation is. Bad experience with a SaaS?

Brilliant website in any case. And I say this as someone who works on a realtime/push SaaS.


My guess: Their motivation is probably that they used a SaaS product, which was totally overpriced for what value it provided and they want to show that they can do it better for cheaper.

Anyway, what exactly is the use of this compared to just using uWS straight away? It’s build on uWS, so this is basically just a pusher implementation and some notification features with cool branding?


> My guess: Their motivation is probably that they used a SaaS product, which was totally overpriced for what value it provided and they want to show that they can do it better for cheaper.

Yes, and what I replied earlier in this thread: I'm not the only one having this issue with overpriced Pusher, I just dont want to be limited by Pusher on how many messages I wanna distribute to my end users.

> Anyway, what exactly is the use of this compared to just using uWS straight away? It’s build on uWS, so this is basically just a pusher implementation and some notification features with cool branding?

uWS is cool to be used in any WebSocket client. However, Pusher has a strict protocol, so I wanted a product that works with any Pusher SDK - so I won't have to rely on custom clients or something of that ilk.


The creator of Soketi here. Even if I have 50-100 concurrent connections on most of the projects, I don't wanna be throttled by how many messages I can distribute to my end users - I might have < 100 users, but maybe I have to distribute fresh updates each 5 seconds, what do I do?


You use a stack which supports it. Elixir and Erlang support millions of concurrent websocket connections on a single, albeit beefy, server.

https://phoenixframework.org/blog/the-road-to-2-million-webs...


The library is built on top of uWebsockets which is fairly well-known as being highly optimised and performant, especially if you skip the Node.js wrapper and use the underlying C/C++ lib directly. Does anyone know what tradeoffs or different performance characteristics one would expect to see from e.g. Elixir/Erlang vs uWebsockets?


Elixir/Erlang are surely slower but the BEAM is a fantastic runtime and compensates with fault-tolerance and predictable performance. I know I prefer my server to be as responsive at 1 million connections as at 1 hundred.


How much slower though, I think we’re talking everyone getting the message in a Phoenix channel in < 100ms?


I can't believe this article is 7 years old.


> Written on top of C, ported to Node.js.

I think what they mean is it uses uWebSockets.js, a Node.js module wrapping a C++ implementation.

https://github.com/uNetworking/uWebSockets.js


If you want a really fast cheap websockets server that scales to 250,000 cc on a single node, I wrote xtomp.tp23.org using nginx as a base.

Its a STOMP protocol server written in non-blocking C. +web sockets.

There is no code required in the nginx part because it implements stomp topics and queues. If you want code, it plugs into a rust based stomp server talking reverse STOMP protocol, so you can code all you like in rust and scale out with n x nginx servers.

It is very very low on cpu use. I wrote it because rabbitmq used 5% cpu while idle. Xtomp uses close to 0% cpu when idle because nginx.


Long time since the last commit. I saw the reference to Ubuntu 16.04. Does it work on current distributions?


I like how the site clearly explains what it is, how it works, and what it does - with benchmarks. I’m not even a hardcore developer.


"This is because you pay only for the infrastructure." It is licensed under AGPL, is there a dual licensing for commercial projects?


I get their goal with the pricing comparison table, but it makes it initially appear like this has an actual cost (when in reality they're just saying all you need to do is put this on a cheap VPS).


They're positioning themselves as a competition to saas, which has a cost. Saying "it is free" is not exactly true either because costumers that are using SaaS typically have weak infrastructure, which means that one way or another they're going to have to spend money to use this.

I love FOSS, but the fact of the matter is that companies don't really care about FOSS. They care that the software they're using is working when they need it, and ultimately paying $49 a month is cheaper than owning or renting infrastructure AND paying someone to administer it in a way that works consistently, when they need it.

Saying "it is free" is true, but the man-hours you're now dedicating to hosting it, monitoring it, the network admin required, the time spent when it's not working, the single point of failure being moved from a datacenter to possibly an office building, the backup process, infratructure and administration, all of that costs money, and you get it all accounted for (and economies of scale cheaper) with SaaS. That is the single biggest reason SaaS is so popular with companies, with enough SaaS you can just rent an office and buy laptops, and only hire devs.


I guess they position themselves as a competitor to Pusher, which is a hosted service.


Not really - more as an open-source alternative that has many benefits for running it yourself instead of paying or being limited by existing, highly-reliable SaaS products.


It has - the server you're hosting Soketi on. That's it.


Soketi is awesome. I’m using it with Laravel on some internal projects and it’s been really easy to setup and almost zero maintenance when up.


The Cloudflare Workers version sounds great. I've been noodling around with this idea a bit too, it's a pleasant surprise to see something out of the box :)


I'm a php & mysql -dev and still can't understand these websockets. What if I have a cron job that sends messages to this websocket server and it pushes them to web-app (vue front, added to home screen on mobile phone, not an installed app) push notification. How this can be done ? and how can the server even keep up with the websocket connections to thousands of clients ? does the websocket re-open if user restarts their phone?


Try https://channelstream.org/ - you can talk via rest calls to it - it scales up to thousands of connections on a single small machine. You have tiny JS WS/long pool clients available with reconnection logic or you can roll your own if you like.


What can I use it for? What is it?


Given the comparison to Pusher and Ably, it looks like it’s an HTTP<>WebSocket bridge. Deploying WebSockets in production systems is tough because they use long-lived connections. Companies like Pusher solve this by serving the long-lived connections on their infrastructure, and relaying messages to your server over webhooks.

It’s used for things like notifying users when they get a DM, or displaying live sports scores.


Would love to see a comparison of this with nginx+node or even nchan


Does anyone know how this compares with centrifugo?


Oof Ably not looking so good suddenly..


I’m really dependent on ably and would like a solid alternative that we can self host but I really love the telemetry that we get in Ably. I wonder if something could be rolled with this and Prometheus.


Ably is awesome. It really is. But not for small developers that have to pay and/or be limited on how many messages you can send.


Ably is solid and generally much cheaper than the alternatives like pubnub.

Also they come with reliable message delivery built in (pusher doesn’t I think). Not really sure how it compares to this project.

Anyways just a happy user of ably, used it at work.


> Price: $5 (a DigitalOcean instance)

> Connections: Unlimited

> Messages: Unlimited

Yeah...there is still a limit to what a $5 instance can handle.


That 5$ instance will cover 90% of the needs of 90% of the businesses out there.

You. Are. Not. Google/Facebook/Netflix/TikTok.


> You. Are. Not. Google/Facebook/Netflix/TikTok.

That cannot be repeated enough. 90% of the tech flaunted here on HN is interesting only on a technical level, never in a business setting.

I suspect Google released Kubernetes to hamstring all competition. You do not need it. Unless you're Google.


I agree with the “you are not FAANG” sentiment and I think HN could use the frequent reminder, but I’ve come around on Kubernetes. As soon as you have multiple services that need to talk to each other in multiple environments (staging, prod, etc), infrastructure-as-code is immensely useful. Kubernetes lets you do IAC without tying yourself to a particular cloud.

So it’s overkill for a CRUD app, but you certainly don’t need the scale of Google to find it useful.


Funnily enough most of those pods and serverless functions etc. will likely have magnitudes less available resources than a 5$ instance on Digital Ocean.

But... but... Google are doing it!


I would state this as "you'd be surprised by what you can do with a monolith on a single server"


The $5 instance can easily handle 50k connections, depending on what you're doing. I scaled to 40k clients and 50 megabytes a second sustained on a $10 Linode (but that was nchan, not this). That was after my first 50 paying customers...




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: