I create a new asp net core website on IIS and worked properly, but after publish the load balancer a new issue appears which is after login to the system, the SignalR connection closed immediately and logout from website due to session timeout. Noting that no clear error appears. Any advice please.
CodePudding user response:
In load balanced environments SignalR needs to be back-planed, this puts what would otherwise have been stored in your webservers memory into a database. Without back-planing when a SignalR reply comes in via the load balancer and does not end up at the server which originally asked for the reply from the servers POV the reply isn't in response to anything since it has nothing in memory.
Back-planing is really easy. High level overview here: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr
Database specific instructions...
Redis: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis
SQL Server: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-sql-server
CodePudding user response:
It is recommended to enable SignalR tracing on the server to view diagnostic information about events in SignalR applications.