How to automatically scale Azure App Services | Azure Tips and Tricks

Microsoft Azure
25 Mar 202202:59

Summary

TLDRThis Azure Tips and Tricks episode teaches viewers how to scale Azure App Services automatically. It covers manual and custom autoscale options, using metrics like CPU percentage, TCP packets, and HTTP queue length to trigger scaling. The tutorial demonstrates setting up scale rules with conditions, cooldown periods, and instance limits. It also discusses scheduling scaling for cost-effectiveness during different times, such as scaling in on weekends and out during high-traffic events like Black Friday. The video concludes by highlighting the benefits of auto-scaling for maintaining performance and optimizing costs.

Takeaways

  • πŸ”§ Azure App Services allows for automatic scaling to adjust the number of instances running an application.
  • πŸ“ˆ Scaling out increases instances, while scaling in decreases them, helping manage load and resource allocation.
  • πŸ› οΈ Custom autoscale can be configured based on specific scale conditions and rules.
  • πŸ“Š Scale rules are based on metrics such as CPU percentage, TCP packets, HTTP queue length, or data throughput.
  • ⏱️ The script demonstrates setting a scale action based on data output exceeding 70 bytes on average over 10 minutes.
  • πŸ”„ A cool-down period of five minutes prevents frequent scaling actions for the same rule.
  • πŸ“‹ Instance limits can be set to ensure there's a minimum and maximum number of instances running.
  • πŸ“… Scheduled scaling can be used to scale in during low-traffic periods and scale out during peak times like Black Friday.
  • πŸ”½ A rule to scale in is necessary to decrease instances when the metric falls below a certain threshold.
  • πŸ“Š The run history provides visibility into when scaling actions are executed, helping monitor the performance and efficiency of the scaling settings.

Q & A

  • What does scaling out and in in Azure App Services refer to?

    -Scaling out and in refers to increasing or decreasing the number of instances that run your application, such as scaling up or down the number of web app instances.

  • How can you configure scaling for an Azure App Service web app?

    -You can configure scaling by going to the scale out menu of your existing app services web app, where you can manually scale the instances or set up automatic scaling.

  • What is custom autoscale in Azure App Services and how does it work?

    -Custom autoscale in Azure App Services works based on scale conditions that define rules for scaling in and out based on metrics such as CPU percentage, TCP packages, HTTP queue length, or data streaming out of the web app.

  • What metrics can be used to create a scale rule in Azure App Services?

    -Scale rules can be based on metrics such as CPU percentage, TCP packages, HTTP queue length, or the amount of data streaming out of the web app.

  • How does the metric value display help in setting up scale actions?

    -The metric value display shows the metric value for the last 10 minutes, helping to determine a reasonable value for setting up scale actions.

  • What is a scale action and how is it activated in the script?

    -A scale action is activated when a certain condition is met, such as when the amount of data flowing out is greater than 70 bytes on average for the last 10 minutes.

  • What is the purpose of the cool down period in scaling rules?

    -The cool down period, set to five minutes in the script, prevents additional scale actions from executing for a rule within that time, allowing the system to stabilize after a scale action.

  • How can you set instance limits for a scale condition in Azure App Services?

    -You can configure the instance limits for a scale condition by setting a minimum and maximum number of instances, with a default fallback if something goes wrong.

  • How can you use scaling to save costs or prepare for high traffic events?

    -You can schedule scaling to save costs by scaling in during low-traffic periods like weekends, and scale out during high-traffic events like Black Friday by setting up specific scale conditions.

  • What happens when the scaling condition is met and how can you monitor it?

    -When the scaling condition is met, the app scales up or down according to the rules set. You can monitor these scale actions in the run history of the Azure App Services.

  • What is the benefit of auto-scaling in Azure App Services as described in the script?

    -Auto-scaling in Azure App Services allows you to serve users effectively during busy periods and save money during idle times by automatically adjusting the number of instances based on predefined conditions.

Outlines

00:00

πŸ“ˆ Auto-Scaling Azure App Services

This paragraph explains how to configure auto-scaling for Azure App Services. It discusses scaling out and in, which refers to increasing or decreasing the number of instances running an application. The speaker demonstrates how to set up custom autoscale rules based on metrics such as CPU percentage, TCP packets, HTTP queue length, or data outflow. An example is given where the app scales up by three instances if the data outflow exceeds 70 bytes on average over the last 10 minutes. A cooldown period of five minutes is also set to prevent frequent scaling actions. The speaker also shows how to set instance limits and create additional rules for scaling based on a schedule, such as scaling in during weekends to save costs or scaling out during peak events like Black Friday. The paragraph concludes with a mention of the benefits of auto-scaling, which include serving users efficiently during high traffic and saving resources when demand is low.

Mindmap

Keywords

πŸ’‘Azure App Services

Azure App Services is a cloud service offered by Microsoft that allows developers to build, deploy, and manage web apps, mobile apps, and API apps. It is a central theme of the video as it discusses how to scale these services automatically. The script mentions configuring scaling within the 'scale out menu' of an existing app services web app, indicating that Azure App Services provides tools for managing and scaling applications.

πŸ’‘Scaling out and in

Scaling out and in refers to the process of increasing or decreasing the number of instances that run an application. In the context of the video, this is a key concept as it demonstrates how to manage resources effectively by adjusting the number of web app instances up or down based on demand. The script explains that scaling out means increasing instances and scaling in means decreasing them.

πŸ’‘Autoscale

Autoscale is a feature that allows applications to automatically adjust the number of instances based on certain conditions or rules. The video emphasizes the importance of autoscaling by showing how to set it up in Azure App Services. The script describes choosing 'custom autoscale' and setting up scale conditions based on metrics like CPU percentage, which is crucial for efficient resource management.

πŸ’‘Scale conditions

Scale conditions are the rules that define when and how an application should scale. They are based on specific metrics and can trigger scaling actions. The video script mentions adding a scale rule that works on metrics such as the CPU percentage or HTTP queue length, showcasing how these conditions can be configured to scale the application in or out.

πŸ’‘Scale rule

A scale rule is a specific condition that, when met, triggers a scaling action. The script explains that a scale rule works on metrics and can be set to scale in or out based on these metrics. For example, the video describes setting a rule where if the data flowing out is greater than 70 bytes on average for the last 10 minutes, the app will scale up.

πŸ’‘Cooldown period

The cooldown period is a time interval after a scaling action during which no other scaling actions are taken for that rule. This helps to stabilize the system and prevent rapid, unnecessary scaling. The script mentions a cooldown period of five minutes after scaling up, which prevents additional scale actions for that rule during that time.

πŸ’‘Instance limits

Instance limits are the minimum and maximum number of instances that an application can scale to. They ensure that the application has a consistent number of instances within a specified range. The video script discusses setting a minimum of one instance and a maximum of six for a scale condition, which helps in managing resources effectively.

πŸ’‘Schedule-based scaling

Schedule-based scaling is a method of scaling where the application adjusts the number of instances based on a predefined schedule. This is useful forι’„θ§ζ€§εœ° managing resources during expected high or low traffic periods. The script gives an example of scaling in to save costs on weekends and scaling out during high-traffic events like Black Friday.

πŸ’‘Scale-in and scale-out

Scale-in and scale-out are actions that reduce or increase the number of instances, respectively. The video script discusses creating rules for both actions to manage the application's resources efficiently. For instance, scaling out when the metric is high and scaling in when it is low helps in optimizing costs and performance.

πŸ’‘Run history

Run history is a record of the scaling actions that have been executed by the application. It provides insights into how the autoscaling feature has been performing. The script mentions checking the run history to see when the app scaled up, which is important for monitoring and troubleshooting the scaling process.

πŸ’‘Cost savings

Cost savings refer to the reduction in expenses by efficiently managing resources. In the context of the video, scaling out during high demand and scaling in during low demand can lead to cost savings. The script highlights the importance of auto-scaling as a feature that helps in serving users when the app is busy and saving money when it is not.

Highlights

Azure App Services can automatically scale out and in by increasing or decreasing instances.

Manual scaling allows for setting a fixed number of instances for a web app.

Custom autoscale is based on scale conditions that trigger scaling in or out.

Scale rules are based on metrics such as CPU percentage, TCP packages, HTTP queue length, or data outflow.

The metric value for the last 10 minutes is displayed, aiding in setting reasonable scale thresholds.

A scale action can be activated when data outflow exceeds 70 bytes on average over 10 minutes.

Instances can be increased by a set number, with a cooldown period preventing immediate additional scale actions.

Instance limits can be configured to ensure a minimum and maximum number of instances.

Default instance numbers are used as fallbacks in case of issues.

Additional scale conditions can be added for different scenarios, like scaling based on a schedule.

Scaling in can be configured to save costs during low-traffic periods like weekends.

Scaling out can be scheduled for high-traffic events like Black Friday.

Scale-in rules can be created to decrease instances when traffic is low, balancing scale-out actions.

Scaling settings can be saved and monitored through the run history.

Auto-scaling ensures continuous service during high demand and cost savings during low demand.

Azure App Services' auto-scaling feature is powerful for managing resource allocation efficiently.

Transcripts

play00:00

>> Learn how to automatically scale

play00:02

Azure App Services in this episode of Azure Tips and Tricks.

play00:07

Scaling out and in means that you increase or

play00:11

decrease the amount of instances that run your application.

play00:15

For a web app, that means scaling

play00:17

the amount of web app instances up or down.

play00:20

Let's see how that works.

play00:22

Here in the scale out menu of my existing app services web app,

play00:26

I can configure scaling.

play00:28

I can manually scale the amount of

play00:30

instances up and down or automatically.

play00:33

Let's choose custom autoscale.

play00:36

This works based on scale conditions.

play00:39

A condition scales in and out based on rules. Let's add one.

play00:44

A scale rule works on metrics.

play00:47

For instance, the CPU percentage of the web app or something else,

play00:51

like TCP packages or the HTTP queue length,

play00:56

or the amount of data that streams out of the web app.

play00:59

This is pretty cool. It shows

play01:02

the metric value for the last 10 minutes.

play01:04

I can see what is a reasonable value.

play01:07

I'll leave this as it is.

play01:10

This means that a scale action

play01:12

is activated when the amount of data

play01:14

flowing out is greater than

play01:16

70 bites on average for the last 10 minutes.

play01:20

When that happens, I want to increase

play01:22

the amount of instances by three,

play01:24

and it won't execute

play01:26

additional scale actions for this rule for five minutes,

play01:29

which is the cool down period.

play01:32

Add it. I can also configure

play01:35

the instance limits of this scale condition,

play01:37

so it will have a minimum of one instance and a maximum of six.

play01:43

If something goes wrong,

play01:45

it will fall back on the default number,

play01:47

which is one instance.

play01:49

I can add more conditions like this.

play01:53

For instance, one that scales to

play01:54

a specific number of instances based on a schedule.

play01:58

I can use this to, for instance,

play02:00

scale-in to save costs on

play02:02

the weekend or scale-out on something like Black Friday.

play02:06

As this condition only scales out,

play02:09

I should also create a rule that scales in like this.

play02:13

So the same metric, but

play02:14

now when it is less than 70 bytes,

play02:17

I decrease the number of instances by three.

play02:21

This will negate the scaling up from when it is busy.

play02:25

Now, I'll save the scaling settings, and that's it.

play02:30

When users start using the app and scale actions are executed,

play02:35

I can see them here in the run history. Let's see.

play02:39

It showed that the app scaled up right here, so it worked.

play02:44

Auto-scaling is a powerful feature

play02:46

of Azure App Services that enables

play02:49

you to keep serving users when it is

play02:51

busy and save money when it is not.

play02:53

Go and check it out.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Azure TipsAuto-ScalingApp ServicesPerformanceCost-SavingWeb AppsInstance ScalingCloud ComputingTech TutorialScale Rules