Reputation: 1551
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).
How does one modify the maximum number of simultaneous web requests in an Azure Web Application?
Is there a way to monitor connection queues in Azure?
Upvotes: 8
Views: 23791
Reputation: 497
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://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests.
Upvotes: 6
Reputation: 27793
The load test result does not stand for the http request number limit of the web app, it just indicates load test tool simulates these requests per second. The test result could be affected by concurrent customer number, App Service plan tier, instance count and URLs etc.
Here is a test result (web app with S1 app service plan, 250 concurrent customers, URL point to a static html page)
CPU and Memory usage
From above screenshots, we could find that it just uses a little of CPU and memory resource during the time we do the load test. And the result 226.49 req/sec is not the actual max number of request that web app could handle.
Besides, if App Service plan you are using now could not meet your app requirement, please try to scale your App Service plan.
Upvotes: 1
Reputation: 155
you can check here on the limitations of web apps. does increasing the size of web app help? https://learn.microsoft.com/en-us/azure/azure-subscription-service-limits#app-service-limits
you can also use application insights and new relic extensions in web app and monitor incoming traffic and get to the bottleneck.
Upvotes: 0