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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With