Load balancing in Redis cluster mode
Currently, when using redis-streams-adapter,
it appears that the load is only directed to one master node in the cluster.
If you check the code, it seems that streamName is used as a key for all requests,
and in this case, I know that it is concentrated on only one node according to the redis HashTable.
Is there a way to load balance redis when using this adapter?
At least I think I need to use different nodes for each Room/Namespace.
If there is a way to load balance, please let me know.
Hi!
You are right, there is currently no way to share the load between several primary nodes.
I am open to suggestions on this matter.
What we could do is to have N streams, and hash the namespace to select the stream to use.
This way:
- the load is divided between the namespaces (not evenly though)
- message order is still guaranteed
What do you think?
Is there any way they can use multiple streams, at least a different stream per namespace or at least group each x rooms and create a stream every x rooms?