Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MaxConnections in Azure Web App?

I have an Azure Web App that I suspect is running into a max connection limit (i.e. maximum number of HTTP requests that can be active at the same time).

  1. How does one modify the maximum number of simultaneous web requests in an Azure Web Application?

  2. Is there a way to monitor connection queues in Azure?

like image 248
user1142433 Avatar asked Dec 07 '16 23:12

user1142433


1 Answers

First thing to check: are you using static HttpClient? If not, I would fix that first, then re-run your load test.

Long story short, you shouldn't need to modify the maxconnection settings. The max is set by the version of .NET and it is a very, very high number. If you suspect you are running out of sockets, you should do a load test and measure number of SocketExceptions.

Since we're in the topic of resource constraints, are you also using async calls. Specifically, async in your WebAPI controller down to every dependency in your codebase.

private static HttpClient Client = new HttpClient();

As a best practice, you should consider using HttpClientFactory to handle managing the lifetime of HttpClient instances as described in https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests.

like image 126
jchang1 Avatar answered Oct 08 '22 00:10

jchang1