Saturday, June 13, 2020

Vertical and Horizontal Scaling

One of the major benefits of using the cloud is scalability. With Azure autoscaling, you can scale up and out like you couldn’t do with your own hardware, as much as your wallet allows. But more importantly, you can scale down and in when you don’t need the resources, thereby saving money.

Basically, there are two main ways to scale resources:

1.       Vertical (Scaling up and down)

2.       Horizontal (Scaling out and in)

Vertical (Scaling up)

Upgrade the capacity of the host where the app is hosted (PAAS environment). Scaling up and down speaks for itself, you scale the number and power of resources up and down. For instance, you provision a bigger server with more horsepower to scale up and a smaller, slower one to scale down.


As you know in last post (Create Web App), I have created “DJBlogsAppPlan” App Service plan for my Web App (djblogs). Here I will show how we can “Scaling up” this Web App. Open App Service Plan “DJBlogsAppPlan” as below




Once you open “DJBlogsAppPlan” click on App Service Plan “Scale Up” link

Based on your requirement you can select the pricing tier which suits to you budget and application.This case I have scale up from Free  to S3 Price Tier. You can scale up when your web app has high traffic and scale down when minimum traffic. It will save your budget. In future post I will show how we can automate it.

Horizontal (Scaling out)

Upgrade the capacity of the app by increasing the number of host instances (PAAS Environment). Ex: Having a Load Balancer where your app is hosted on multiple instances.

Scaling out and in is different. When you scale out, you increase the number of hardware resources that the application runs on – you increase several instances. This could mean that instead of using 2 servers, you use 3. Scaling in is the opposite: you decrease the number of instances that your application runs on.


As above you can down scale out and in from azure portal from App Service Plan. Open the App service plan attached with Web App and Click on Scale Out link as below screen and you can add your scale out and scale in condition there.

There are 2 options for scale out

1.       Manual Scale-out

2.       Custom Scale-out

Manual Scale-out

Manual scale is the default setting during cluster creation. The cluster has a static capacity that doesn't change automatically. You select the static capacity by using the Instance count bar. The cluster's scaling remains at that setting until you make another change.

Custom Scale-out

You can scale out your cluster dynamically based on some of the metric like CPU usages, memory usages etc. Based on your requirement you can add rules when you define custom auto scale.   

You can scale your cluster dynamically based on metrics that you specify. The following graphic shows the flow and steps to configure custom auto scale. More details follow the graphic.

1.       In the Auto scale setting name box, enter a name, such as Scale-out: CPU utilization.


2.       For Scale mode, select Scale based on a metric. This mode provides dynamic scaling. You can also select Scale to a specific instance count.

3.       Select + Add a rule.

4.       In the Scale rule section on the right, enter values for each setting.

5.       Select Add.

6.       In the Instance limits section on the left, enter values for each setting.

7.       Select Save.

We have now configured horizontal scaling for our Azure Web App(djblogs). That all about scaling. I will share more about in future post.

Keep sharing keep learning. Thank you 

No comments:

Post a Comment