question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignalR: The server disconnected before sending a handshake response

See original GitHub issue

Issue moved from dotnet/aspnetcore#26032


From @mhardy on Thursday, September 17, 2020 8:37:33 PM

I have a Blazor Server app that has been working perfect with a small group of 10 users. I’m hosting it on a B1 App Service Plan and using an Azure SignalR Standard Service with 1 Unit. I just rolled it out 200 people, and it only took a few dozen to cause hundreds of exceptions. Memory never exceeds 60%, SignalR service has 120 max client connections, 16 max server connections.

I have SignalR debug logging enabled. Digging through the exceptions I’m seeing hundreds of these:

The server disconnected before sending a handshake response

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I can’t reproduce the issue locally because it only occurs under load.

.NET Core 3.1 “Microsoft.AspNetCore.SignalR.Client” Version=“3.1.8” “Microsoft.Azure.SignalR” Version=“1.5.1”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mhardycommented, Oct 28, 2020

I’ve already done significant artillery testing. That’s been helpful but as noted doesn’t take into consideration SignalR. I’ll take a closer look into crank.

By pulling out the custom hub as described above my application has stabilized. It’s now been rolled back out to the wider audience and there have been no exceptions or CPU spikes for two weeks. Thanks for all the feedback.

0reactions
vicancycommented, Oct 29, 2020

Thanks for the update, I am closing the issue as the original issue is addressed. Feel free to open another issue if you have further questions for example performance test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SignalR Disconnects Immediately with no code changes ...
When I load the page, the app starts up and the SignalR connection is started. The negotiation succeeds and the connection to the...
Read more >
ASP.NET Core SignalR connection troubleshooting
This section provides help with errors that can occur when trying to establish a connection to an ASP.NET Core SignalR hub.
Read more >
Understanding and Handling Connection Lifetime Events ...
This article provides an overview of the SignalR connection, reconnection, and disconnection events that you can handle, and timeout and ...
Read more >
SignalR keep disconnecting every 30 seconds : r/dotnet
No need to keep them so long since the server is just hanging on to dead connections. Default handshake timeout is 15 seconds....
Read more >
Advanced SignalR configuration: fine-tuning the server-side ...
When client establishes a connection with a SignalR hub, it initiates a handshake. This setting determines how long the server should wait ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found