Websocketd – It's like CGI, twenty years later, for WebSockets
websocketd.com
websocketd.com
>>> gwsocket is a simple, standalone, language-agnostic, RFC6455 compliant WebSocket Server, written in C. It sits between your application and the client's browser, giving fast bidirectional communication between these two with ease and flexibility
Ideally I'd like to have a standalone websocket service that handles long-running connections and then calls my specified API eg. `POST <my-http-service>/websocket/client/<client_id>`. Then the service can respond by sending a `POST <my-websocket-service>/websocket/client/<client>`, like an opensource https://pusher.com? I realise it'd be fairly easy to build myself, just wondering if there is something off the shelf that achieves this?
As far as memory goes, a few thousand identical processes shouldn't be too much, add memory to your computer/VM/droplet/etc until it is enough. You can also rewrite the websocket program from Python to Go (and then to C) to fit more processes into the available memory.
As far as number of processes goes, Linux can probably handle more active processes than the computer's memory can handle.
As far as file handles goes, by default I think you're limited to a few tens of thousands, but there's knobs you can turn to raise that limit.
I would guess (thumbsuck) that you might run into scale-up walls once you have more than 100k active connections on a single Linux instance[1]. At that point you have paying customers that will allow you to spend money on switching from a scale-up-based architecture to a scale-out-based architecture.
[1] My $5/m Digital Ocean droplet once handled ~50k long-lived TCP connections over a two day period without much configuration necessary. ISTR that I had to turn some knobs in /proc/... to raise the limits on file handles.
Isn't this something tcp itself does? So any protocol on top of tcp would inherit the same.
If the client goes offline for longer durations, they should attempt to reconnect after coming online.
See this comment that someone posted here today:
Of course, since it's a library, you still need to write code that calls it.