2
votes

I have a .NET Core 2.1 web app running in Azure App services. Several times lately the app has crashed after encountering a high number of "Connections".

The only documentation I can find says this:

Connections

The number of bound sockets existing in the sandbox (w3wp.exe and its child processes). A bound socket is created by calling bind()/connect() APIs and remains until said socket is closed with CloseHandle()/closesocket().

When looking at the metrics; connections seem to spike while requests stay fairly similar.

What could cause this? The documentation seems to suggest it's the total amount of open TCP connections? If this is just standard API calls; why wouldn't it register as requests also? Could it be caused by an underlying problem (like a dependency), and as response latency increases, connections are being held open?

Requests Connections

Edit: Sorry at the time the web app was running .NET Core 2.2. I've since rolled back to 2.1 and am seeing no instability issues; but neither have I seen another spike in connections.

1
Are you using any external Http calls ? turn on Application Insights. You will in depth analysis and logsImran Arshad
Yeah I've got Application Insights. Not much to go off there. No external HTTP calls, only dependencies are a Redis cache (using Microsoft.Extensions.Caching.Redis) and an Azure SQL Database. Neither dependency had problems around this time.Jono Rogers
You are having no problem with .Net Core 2.1 any more ?Imran Arshad
No I'm not, but Microsoft have responded and told me the app was opening a large amount of connections to localhost. This makes no sense - the app doesn't do that at all, unless in Azure the application configuration settings weren't overridden; and then it would try to connect to Redis on localhost (development setting); or if it's related to the Application Insights issue below.Jono Rogers

1 Answers

0
votes

Since you said you have Application Insights installed, you are most likely the victim of these issues, which are fixed in latest versions:

https://github.com/Microsoft/ApplicationInsights-dotnet/issues/594

https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/690

Please update to the latest stable version of the SDKs are see if it helps.