Autoscale rule for max connection and response time out in azure app service

Viewed 358

When we do a load testing for a Rest API which is developed using dotnetcore with 10000 users and 100 ramp up finally ended up with 502 bad gateway error.

There are many outbound api calls are happening inside our application which uses singletone httpclient instance.

The connections crosses more than 1920 limit and also the response time crosses 2 min default time. Here is appservice metrics. 1

We wanted to set autoscale rule in appservice to balance the load and avoid 502 bad gateway error. But I don't find any options related to connections and response time.

1 Answers

When you're adding a new metric for your autoscaling configuration, the first drop-down you are presented with allows you set the Metric Source. By default this will point to the current resource (which when configuring autoscaling is the App Service PLAN).

You want set this source to "Other resource"

Set Metric Source

Choose the resource type you want and then choose the target resource. In this case, I think you would want the App Service itself (or choose "App Service (Slots)" if you want to target a specific slot).

After changing the resource type, the new Metric Namespace will present different metric choices, one of which will be Response Time.

Choose Response Time from App Service Namespace

I know it's been a while since this was asked, but I hope this helps anyone new showing up here.

Related