Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a list of TCP connection statuses for an Azure App Service app?

Tags:

We have an Azure App Service Plan with 20+ applications.

One of the apps is causing port exhaustion. All the apps on the pricing plan lose connectivity as a result.

Tech support indicate TIME_WAIT status TCP connections are predominant when the port exhaustion happens. To help diagnose and monitor this and future situations, I want a general way of getting TCP connections and statuses per app.

Is this possible? If so how?

like image 753
Sentinel Avatar asked Nov 25 '16 14:11

Sentinel


People also ask

Which service can be used to detect issues in a Web application running on Azure App Service?

Open App Service diagnostics In the left navigation, click on Diagnose and solve problems. For Azure Functions, navigate to your function app, and in the top navigation, click on Platform features, and select Diagnose and solve problems from the Resource management section.

How do I check Azure App Service errors?

Log detailed errors To save the error page or failed request tracing for Windows apps in the Azure portal, navigate to your app and select App Service logs. Under Detailed Error Logging or Failed Request Tracing, select On, then select Save. Both types of logs are stored in the App Service file system.


2 Answers

I realize this isn't a direct answer to your question, but we have a similar issue and found our use of HttpClient to be a contributing factor. If you're using a new HttpClient instance for each of your HTTP requests, you could be exhausting your available outbound connections. We found the following article to be very helpful in minimizing the number of outbound connections using HttpClient: https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/

We are also hoping for a way to view TCP connections from Azure App Services, since Kudu shows "Access Denied" when trying to use netstat.

like image 73
rbakos Avatar answered Sep 28 '22 11:09

rbakos


This is now a popular question. To add some extra info, the outcome of the investigation was that one app was using a MySQL client library that had some kind of bug. It was not closing TCP ports correctly. This killed the whole plan. After talking with Azure tech support they agreed that there should be improved reporting of TCP connectivity in the Azure portal. Since then I have not checked if there have been any improvements.

like image 40
Sentinel Avatar answered Sep 28 '22 10:09

Sentinel