What could be causing a large increase in the socket connections of our App Services?

Lloyd | Boxplosive 0 Reputation points
2025-04-22T13:00:39.7733333+00:00

In the last couple of days, we have seen a structural rise in the number of socket connections for each of our App Services. These App Services run behind an API-Management service instance. However, we do not see a structural rise in the number of requests we receive on our Application Gateway (which is in front of the API-M instance).

This started last Monday evening to Tuesday morning. We have no explanation for this as we did not change anything in that timeframe.

Below are the metrics of the past 7 days.User's image image343

Thank you for any help you can provide!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,767 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prabhavathi Manchala 1,220 Reputation points Microsoft External Staff Moderator
    2025-04-22T18:13:32.19+00:00

    Hi Lloyd | Boxplosive,

    We observed a steady increase in socket connections for your App Services from Monday evening (April 14) to Tuesday (April 15), but the request volume at the Application Gateway remained steady. Possible causes include longer open connections, new code opening more connections, App Service scaling adding more instances, Azure managing connections to prevent source network address translation (SNAT) exhaustion, or a connection leak.

    • Check recent deployments for any code changes made around Monday evening, even if they seem unrelated.
    • Make sure all connections and resources are properly closed, use connection pooling, and dispose of resources correctly.
    • Check App Service logs and diagnostics, enable diagnostics, look for exceptions in Application Insights, and review worker process restarts.
    • Optimize connection management by using persistent connections, connection pooling, retry policies with circuit breakers, and HTTP/2 to reduce overhead.
    • Check for dependency issues by reviewing changes in external services your app relies on and monitoring connection timeouts and response times.

    Please refer to the document below for troubleshooting outbound connection errors in Azure App Service.

    Troubleshooting intermittent outbound connection errors in Azure App Service - Azure App Service | Microsoft Learn

    Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    Let me know if you have any further Queries.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.