Lee Smith
Lee Smith

Reputation: 6737

Cannot scale Azure App Service by number of requests

I'd like to scale my Azure App Service by the average number of requests (over all instances).

The configuration in the image below should increase the instance count by 1 if there are more than 200 requests per minute.

However,

  1. It doesn't work (it is not scaling)

  2. The text says 1 minute but the graph is grouped by 5 minute intervals?

Does anyone know where I'm going wrong?

enter image description here

Upvotes: 0

Views: 1368

Answers (1)

PerfectlyPanda
PerfectlyPanda

Reputation: 3456

If you want to see what is going on behind the scenes, you can turn on logging. It will output data about all the metrics being evaluated and give you some good information on why it isn't deciding to scale.

enter image description here That being said, it would be good to know how the different settings so that you know what you are looking at in the metrics. I'm going to go in a slightly different order from the portal as I think it will make more sense.

Time Grain (in mins): We need an amount of time that will count as a "bin" for our metric. It wouldn't make sense to evaluate the data every second or millisecond since it would require more overhead than necessary. In this case, we will pull a value every minute. Since you want to look at the number of requests per minute, a one minute bin makes sense.

Time Grain Statistic: How we evaluate the data inside that bin based on the actual sampling interval. If you want to increase the count if there are more than 200 requests a minute this needs to be set to Sum

Duration: How far back we are going to look. You have this set to five minutes, there will be five values to evaluate-- one for each minute. This lets you smooth out sudden spikes.

Time Aggregation This is closer to the top but it is similar to the Time Grain Statistic as it defines how to evaluate the five values it pulled from the "bins". You don't want Total or Count for this type of rule, but Average, Minimum, Maximum, and Last are all good choices depending on how aggressively you want to scale.

Upvotes: 2

Related Questions