Which adapter to chose - sticky session #5178
Unanswered
JojoRebondy
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone.
I'm trying to chose which adapter is best suited in my use-case which is the following:
We have several servers, each server have several worker that have a socket.io server listening to incoming connections.
Here are our needs:
Since we need to be long polling compatible, we need to be able to redirect an incoming connection onto the good server & worker if that's not the first request.
For that problem we thought about using a redis adapter coupled with a sticky session mechanism (either with a proxy or with the library socket.io-sticky)
The problem is: the redis adapter is NOT compatible with connection state recovery.
We then thought about using the redis stream adapter, which is connection state recovery compatible.
When trying to implement the redis stream adapter coupled with @socket.io/sticky we kept having the following error:
`
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
code: 'ERR_INTERNAL_ASSERTION'
}
`
We did not find yet a solution for that crash. Furthermore we learned that Redis Stream Adapter does not provide an Emitter so that's no good for us.
Here is an image (found in the socket.io-sticky README.md) that seems to describe exactly our use case, yet it does not work for us.
There are high chance that we are doing something wrong, but also a good chance that we are not using the right tool for our use-case.
If anyone has any knowledge on this subject, a little help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions