Signalr with session affinity #1511
-
Hello all! I have a problem with Signalr and multiple services providing the signalr hub in combination with YARP. Most likely its caused by lacking session affinity. Looking at the docs I didn't see anything specific about that so I am wondering what the best way to solve that is? In addition, we have multiple services running YARP for redundency so session affinity should also work with that in the scenario. Thanks a lot for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Session affinity is covered here: https://microsoft.github.io/reverse-proxy/articles/session-affinity.html The default session affinity cookie generator uses a stable algorithm (the destination name) so it should work across instances so long as you have shared data protection keys to read the cookies. How is traffic routed across redundant YARP instances? Using an L4 proxy? Those often have an affinity option as well. |
Beta Was this translation helpful? Give feedback.
Session affinity is covered here: https://microsoft.github.io/reverse-proxy/articles/session-affinity.html
The default session affinity cookie generator uses a stable algorithm (the destination name) so it should work across instances so long as you have shared data protection keys to read the cookies.
https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-6.0#persistkeystofilesystem
How is traffic routed across redundant YARP instances? Using an L4 proxy? Those often have an affinity option as well.