You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.
The websocket server scales naturally on Node.js cluster without any 3rd party dependencies like Redis. Also there is no need of sticky sessions.
It's pretty cool (I can suggest it handles by master process) but, it's only scalability on the one machine.
How it can be scale for several servers ?
If one connection will serve by one node, and the second connection in another node. So we can't send message from first node socket to another node sockets, isn't it?
Hey. I was researching this a bit, and here are results:
The easiest and most obvious way to share websocket messages between node workers has to be redis pubsub.
It's not possible atm to use current addon interface because topic can be absent on the worker. Also, if you use broadcast method you should somehow avoid publishing message twice (via direct broadcast call and from a subscriber)
So what I've done was this package adonis-ws-redis-provider. If anybody could take a look and advice it would be perfect.
From @ed-fruty on September 20, 2018 17:57
From the docs I read this:
It's pretty cool (I can suggest it handles by master process) but, it's only scalability on the one machine.
How it can be scale for several servers ?
If one connection will serve by one node, and the second connection in another node. So we can't send message from first node socket to another node sockets, isn't it?
Can we resolve this with adonis ?
I mean schema something like this
With socket.io it's just makes through redis adapter.
Copied from original issue: adonisjs/core#955
The text was updated successfully, but these errors were encountered: