dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.47k stars 10.03k forks source link

Websocket .net core detect when client looses internet connectivity #40612

Open dscaravaggi opened 2 years ago

dscaravaggi commented 2 years ago

Is there an existing issue for this?

Describe the bug

Hi all, sorry to ask again about: https://github.com/dotnet/AspNetCore.Docs/issues/9053 , but I'm experiencing the following scenario

  1. if for any reason I got a primary issue in Layer 3 core switches or maintenance I got mor or less 2.5K websocket clients disappearing at once.
  2. even if we deployed a ws PING/PONG strategy with 60 seconds timeout, the application server (.Net 6 linux) is unresponsive and begin starving, even NLOG traces are interrupted, but the process is not crashing (and maybe a crash will raise a systemd restart)
  3. with lesser connections (about 500 - 800) the application come back to life after 90 seconds and begin tracing again all forced disconnect plus emitting ton of exceptions (up to 20k)

Thanks in advance for your feedback Diego

Expected Behavior

the expected behavior is not starving, the application should resume closing and accepting again connections

another interesting note: in the test dev lab we discarded httplistenser websocket and we tried the obsolete: https://github.com/statianzo/Fleck , Fleck is behaving better we got disconnections on timeout, without starvation.

Steps To Reproduce

the healthcheck will stuck

Exceptions (if any)

exceptions arte not thown in the app, but donet counters are mesuring tons of internal eceptions

.NET Version

6.0

Anything else?

No response

dscaravaggi commented 2 years ago

refer https://github.com/dotnet/AspNetCore.Docs/issues/25256