I've one complex scenario.
I've one web application that will hold SignalR HUB.
This application will be hosted on multiple server.
For ex. Hub1 will be hosted on ServerA and ServerB.
Let say I have few clients on both ServerA and ServerB.
If some one broadcast some message on ServerA, then ServerB will be able to get that message (Even if I pass appropriate ConnectionID)?
I think in SignalR 2.0 you can take a look at Introduction to Scaleout in SignalR
.
I have not tested it, but the docs report that for example Microsoft.AspNet.SignalR.SqlServer
will handle load balancing for you using SQL server.
Ref: http://www.asp.net/signalr/overview/signalr-20/performance-and-scaling/scaleout-in-signalr
Currently I'm using in production the REDIS backplane and it's simply great, simple to setup and inject in your code https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis
Yes, but you need to use a backplane. There are a few supported ones, such as Redis or SQL.
I have used the SQL backplane which uses a table and a BLOB data column that will sync any users/groups/hubs/messages between all instances of SignalR. On application_start, you just add a single line of code to use the SQL backplane and it's all taken care of for you behind the scenes.
If performance is of extreme concern, go with Redis. If you want simplicity and ease of configuration, go with SQL.
http://www.asp.net/signalr/overview/signalr-20/performance-and-scaling/scaleout-with-sql-server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With