Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SignalR (v2+) work with Sticky Sessions without a Backplane?

Is using Sticky Sessions a supported scale out scenario? Has anyone deployed SignalR with Sticky Sessions and were there any unexpected issues?

We're investigating SignalR for a load-balanced, broadcast based project (similar to a stock ticker) where messages latency is an important factor. After reading though the Scale Out documentation it seems that the Backplane model could introduce significant latency in the messages, especially when message rates are high.

I've found some references implying that it would work with some side effects but not what the reliability and performance implications are.

Thanks!

like image 917
mcjarvis-sx Avatar asked Oct 31 '22 17:10

mcjarvis-sx


1 Answers

If you use SignalR without a backplane, any client method invocation will only be able to reach clients connected directly to the server making the invocation.

This might be fine if you are only using Clients.Caller since the caller should always come back to the same server given sticky sessions. This could become an issue if you are using Clients.All, Clients.Others Clients.Client(connectionId), Clients.User(userName), Clients.Group(groupName), etc... In these cases, any client that is connected to a server different from the one executing the Clients... code will not receive the invocation regardless of whether the client is connected to the same Hub, has the right connectionId, etc...

like image 58
halter73 Avatar answered Dec 03 '22 03:12

halter73