Usman Javed
Usman Javed

Reputation: 61

Azure SignalR Service

There is very limited information on azure signalR service. I need to clarify a question so any help would be highly appreciated. how azure signalR service actually scale out ? I mean, as far I have worked on it. it seems that you have to include a primary key of azure signalR service to your hub. you can host you hub anywhere. So how hub scales out.?

Upvotes: 4

Views: 2578

Answers (2)

Glenn Ferrie
Glenn Ferrie

Reputation: 10408

This is the documentation that I found and followed to have a signalr hub that worked across multiple App Service instances but behaving as a single hub.

You need to create a "backplane" in Azure using Storage queues and topics.

Details here: https://learn.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-windows-azure-service-bus

@anthonychu is this still needed / applicable??

Upvotes: 1

Anthony Chu
Anthony Chu

Reputation: 37540

SignalR Service manages all the client connections, as well as certain state information such as group membership. Your ASP.NET Core application establishes a connection to the SignalR Service instance.

When the application wants to send a message to connected clients, it uses this connection to instruct the service to do so. The service can also invoke hub methods via this connection.

You can read more about the service protocol.

When a client initiates a connection, it calls a negotiate endpoint on your ASP.NET Core application, which redirects the client to connect to the SignalR Service instance instead.

Because the ASP.NET Core application only needs to execute hub logic and most of the heavy lifting is done by SignalR Service, your application does not typically have to scale out to handle more SignalR connections. You can scale it based on the needs of the web traffic (serving web API and MVC requests, for example), and you can scale the service based on the needs of your SignalR traffic.

Upvotes: 6

Related Questions