Original: ASP. NET SignalR cluster problems encountered
SIGNALR Cluster
When the number of clients comes up, a server is naturally unbearable. Multiple server cluster deployments are a must-have solution. And then by load balancing, well, it's perfect. But the problems are coming. Each server can only be managed to the client under the current server, such as Server1 to send a message to the client that is connected to server2.
At this time we need "backplane" middleware, what is called the backplane, that is, in the server cluster and add a layer, by the backplane to maintain these servers, like the above Server1 to connect to the Server2 client sent messages, the backplane will tell Server2 to send a message to the client. It's going to be the effect we need.
Redis and SQL Server are commonly used, in fact redis performance is optimal.
SQL Server to do the Backplane
Need to download NuGet package Microsoft.AspNet.SignalR.SqlServer
It is also very simple to configure in the startup class, and the database is SIGNALR. Run the program and we'll get the following tables
Redis to make the Backplane
Need to download NuGet package Microsoft.AspNet.SignalR.Redis
Also configured in the Startup class,
GlobalHost.DependencyResolver.UseRedis ("localhost"6379string" SignalR");
Problems with ASP. NET SignalR Cluster