Background
In terms of web applications, underlying infrastructure plays vital role to cope of with applications performance, traffic surge, complex logic, long running process or execution time. It is one of the most difficult job to calculate the specifications in terms of infrastructure for web applications either it is public facing applications or for particular company.
Most of the cases, there is high chances that there will be requirement to upgrade infrastructure specifications after certain threshold or may be resources are not utilized properly. This is again another hassle for developers, DevOps engineers, or even for management to upgrade those resources which may results in applications downtime, unstable or sometimes modifications in code level as well as quite expensive in overall.
One of the key advantageous of cloud computing is capabilities to scale the solution based on demands.
Azure App service gives various flexible choice in terms of scaling.
Scaling in Azure app services
Azure App service is one of my best service in terms of hosting web applications because of numerous reasons and again scaling is one of my favorite which I use frequently.
Azure provides several flexible options to easily scale your apps either in horizontally by adding multiple instances of those solutions or vertically enabling to add memory, CPU disk to your existing instances.
Scaling Options: Scale Up Vs Scale Out
Scale up and scale out are two primary workflows for scaling.
Scale Out (Horizontal scaling): It is basically adding of multiple instances of the application that runs in your app. In other words, it increases the number of VM instances up to 30 depending upon your pricing tier. However, in Isolated tier, we can further scale up to 100 instances based on our requirements. Additionally, we can do this scale out count manually or set to auto scaling based on some rules.
We can do scale out from azure portal as shown below:
Autoscale is a built-in feature that helps applications perform their best when demand changes. You can choose to scale your resource manually to a specific instance count, or via a custom Autoscale policy that scales based on metric(s) thresholds, or schedule instance count which scales during designated time windows. Autoscale enables your resource to be performant and cost effective by adding and removing instances based on demand.
Select Scale out from left navigation, then we can choose either manual and set instance number as per our requirements or auto scale out based on some rule as shown below:
We have to auto scale setting name with resource group name. We will have some more options like scale mode, rules, instance limit and schedule. This is how we can do horizontal scaling i.e., scale out in azure app services.
Scale up (Vertical scaling):
In this scaling option, we can modify the instance power in terms of CPU, memory, disk space which directly impact the cost. This scale up is done by changing the pricing tier of app service plan. Additionally, based on the pricing tier, different useful features are available with the azure app service like custom domains and certificates, staging slots, autoscaling, instances, daily backups and many more.
Scaling is quite easy to do in azure, I prefer from the portal, portal.azure.com.
Simply, login to the portal, open your app service then you will see following options for scaling:
(this image is from Microsoft docs)
In the scale up, we can see the distinct categories: Dev/Test, Production and Isolated.
Dev/Test:
As name suggest, this category is used for development and testing purposes of the applications with azure app service. There are five separate pricing tiers in Dev/Test category as shown:
F1 (free one), D1, B1, B2 and B3: We can see from above illustration that the resources as well as tentative cost per month based on these pricing tiers.
Another important point to notice is that we can see the included features and hardware after selecting each tier as depicted below.
Note: I am not including cost as cost and plan can modify
F1 Pricing tier (Free Tier):
- No any feature.
- Share Infrastructure 1GB Memory/1GB Storage
- 60 minutes/day compute
D1 Pricing Tier
- Custom domain feature
- Share Infrastructure 1GB Memory
- 240 minutes/day compute
This service plans are using same Azure VMs as other apps, so some apps may belong to other customers.
There is no SLA provided for this service plan and are metered on a per app basis.
Basic Service Plan (B1, B2 and B3)
This plan is for low traffic applications where we don’t need auto scaling and traffic management features. Built-in network load balancing support automatically distributes traffic across instances.
B1 Pricing Tier
Included Features
- Custom domains/SSL
- Manual Scaling up to 3 instances
Hardware:
- 100 total Azure computing units
- 1.75 GB Memory and 10 GB disk storage
- A-series computing equivalent
B2 and B3 have same features as B1, however, hardware contents are different.
B2 Hardware:
- 200 total Azure computing units
- 3.5 GB Memory and 10 GB disk storage
- A-series computing equivalent
B3 Hardware:
- 400 total Azure computing units
- 7 GB Memory and 10 GB disk storage
- A-series computing equivalent
Production
By name, it is clear that we use this category for production workloads of the applications. Again, there are two types under this category: standard and premium pricing tiers.
This category has standard pricing tier, S1, S2 and S3 and premium tier P1V2, P2V2, P3V2, P1V3, P2V3 and P3V3.
All these tiers have custom domains/SSL, Auto Scale, Staging Slots, Daily backups, and Traffic manager features.
Standard Service Plan
Pricing is based on the size and number of instances you run. Built-in network load balancing support automatically distributes traffic across instances.
S1, S2 and S3 are available pricing tiers in this with following specifications:
- Auto Scale up to 10 instances
- 5 Staging Slots
- 10 times daily backup
- S1: 100 ACU, 1.75 GB memory, and 50 GB storage
- S2: 200 ACU, 3.5 GB memory, and 50 GB Storage
- S2: 400 ACU, 7 GB memory, and 50 GB Storage
- All these are A-series equivalent
Premium Service Plan
This service plan is intended for enhanced performance with faster processor, SSD storage, and double memory-to-core ratio compared to standard.
Premium V3 – faster processor, Hyper-V virtualization and support for VNet connectivity
P1, P2, P3, P1V2, P2V2, P3V2, P1V3, P2V3 and P3V3 are available pricing tiers for this option with following specifications
- Auto Scale up to 20 instances
- 20 Staging Slots
- 50 times daily backup
- P1: 100 ACU, 1.75 GB memory, and 250 GB storage
- P2: 200 ACU, 3.5 GB memory, and 250 GB Storage
- P2: 400 ACU, 7 GB memory, and 250 GB Storage
- P1V2: 210 ACU, 3.5 GB memory, and 250 GB storage
- P2V2: 420 ACU, 7 GB memory, and 250 GB Storage
- P3V2: 840 ACU, 14 GB memory, and 250 GB Storage
- P1V3: 195 minimum ACU/vCPU, 2vCPU, 8 GB memory, and 250 GB storage
- P2V3: 195 minimum ACU/vCPU, 4vCPU, 16 GB memory, and 250 GB storage
- P3V3: 195 minimum ACU/vCPU, 8vCPU, 32 GB memory, and 250 GB storage
The new PremiumV3 pricing tier provides us quite faster processors, SSD storage, and quadruple the memory-to-core ratio of the existing pricing tiers (double the PremiumV2 tier). With the performance benefit, we could save money by running your apps on fewer instances
Note: If we don’t see P1V3, P2V3, and P3V3 as options, or if the options are greyed out, then PremiumV3 likely isn’t available in the underlying App Service deployment that contains the App Service plan. We might need to change region and resource group combinations.
Isolated Service Plan
This service plan is specifically considered for mission critical workloads, that are required to operate in a virtual network. An ASE is a powerful feature offering of Azure App Service that gives network isolation and improved scale capabilities. This service plan enables consumers to run their applications in a private, dedicated environments in Azure datacenter using Dv2-series VMs, is also called as App Service Environment. The plan can scale to 100 instances with more available upon request.
Isolated V2 plan
This service plan has been enhanced for workloads demanding resource isolation, maximum scalability, and advanced networking features. Isolated v2 allows customers to run their apps in a private, dedicated environment in an Azure datacenter with no public internet dependencies in the customer’s network.
Conclusion:
In this article, we have learned about various scaling options available for Azure App service for Dev/Test, Production workloads as well for isolated environments. The horizontal and vertical scaling with several extensive features is readily available based on service plans and can be implemented just in a click.