'Application got slower after adding signalr withAutomaticReconnect and set KeepAliveInterval time in rest service
Tech stack Angular 6 signalr Client for Angular 3.0 Asp.Net core 2.0
client application connect with four rest api's. So therefore, there are four hubconnection in client side
this.connection = new HubConnectionBuilder()
.withUrl(this.signalRurl, {
skipNegotiation: true,
transport: HttpTransportType.WebSockets
})
.withAutomaticReconnect()
.build();
this.bookingConnection = new HubConnectionBuilder()
.withUrl(this.bookOpsUrl, {
skipNegotiation: true,
transport: HttpTransportType.WebSockets
})
.withAutomaticReconnect()
.build();
this.paymentConnection = new HubConnectionBuilder()
.withUrl(this.payOpsUrl, {
skipNegotiation: true,
transport: HttpTransportType.WebSockets
})
.withAutomaticReconnect()
.build();
this.roomsConnection = new HubConnectionBuilder()
.withUrl(this.roomOpsUrl, {
skipNegotiation: true,
transport: HttpTransportType.WebSockets
})
.withAutomaticReconnect()
.build();
I added KeepAliveInterval time for 240 minite in Asp.net core web api
services.AddSignalR(hubOptions =>
{
hubOptions.KeepAliveInterval = TimeSpan.FromMinutes(240);
});
Now, When I deploy application to the server , I show slowness came from Client application than previous version So Could you please help me over come this issue
Solution 1:[1]
You're going to be seeing constant reconnect attempts from the clients because you changed KeepAliveTimeout on the server without updating the ServerTimeout on the clients. https://docs.microsoft.com/aspnet/core/signalr/configuration?view=aspnetcore-6.0&tabs=dotnet#configure-server-options
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Brennan |