Are all clients in a group assured to receive signalR calls when SignalR is scaled out behind load balancer?

StackOverflow https://stackoverflow.com/questions/23666458

Pergunta

I've been looking into SignalR implementation incorporated with a load balancer and have a few basic (if not simple sounding) questions. I must preface this by saying I've got zero (0) experience with load balancers.

We will have 2 servers sitting behind a load balancer. The client is an ASP .Net application. We've been told that the load balancer maintains session affinity.

Consider the following scenario:

Client1 & Client2 -- connect to GroupA--> Server1
Client3 & Client4 -- connect to GroupA--> Server2

1) Server1 makes a client call to GroupA - this assumes that Clients 1-4 will get the notification, correct?

2) How does the processing occur on this?

3) Is it a function of SignalR itself, or the load balancer?

4) When sending messages at the group level, do messages only get delivered to the client apps associated with the group on that specific server, or will messages get forwarded to all clients of that group?

Does anyone have any thoughts on this?

Thanks, JB

Foi útil?

Solução

I believe the scenario you're looking at requires a SignalR Backplane to be setup.

Here's a relevant selection from the article but you'll want to read the full thing to answer your specific questions:

Each server instance connects to the backplane through the bus. When a message is sent, it goes to the backplane, and the backplane sends it to every server. When a server gets a message from the backplane, it puts the message in its local cache. The server then delivers messages to clients from its local cache.

enter image description here

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top