Best Practices for Autoscaling in Azure App Service
Autoscaling refers to the process of automatically allocating resources to meet performance requirements. As the amount of work increases, the software may require more resources to continue delivering seamless performance and satisfy service-level agreements (SLAs). Similarly, when the volume of work decreases, the software requires fewer resources, and the ones that are not in use can be de-allocated to save costs. In this article, we will learn the best practices for autoscaling in Azure App Service.
What Is Azure App Service?
Azure App Service is a fully managed HTTP-based service for building, deploying and scaling your web apps. It enables you to develop and host web apps, mobile back-ends, and RESTful APIs in your preferred programming language without managing infrastructure. Azure App Service provides all the tools you need to create Web Apps, Mobile Apps, Logic Apps, API Apps, and more.
What Are the Best Practices for Autoscaling in Azure App Service?
Autoscaling leverages the elasticity of cloud-based environments while reducing management overhead. It minimizes the need for an IT professional to constantly monitor the performance of an application and decide about the allocation, de-allocation, or re-allocation of resources. Here are some tips that will help you take the maximum advantage of the service.
Minimum and Maximum Require Different Values
Ensure that the minimum and maximum values are different and have a sufficient margin between them. Suppose you have set up the minimum value to 4, maximum value to 4, and the current instance count is 4, scaling cannot take place. As scaling occurs between the minimum and maximum instance counts, you will need to keep an adequate margin between them.
Pay Attention While Setting Up Values
Manual scaling is temporary and is reset by autoscaling to the minimum and maximum values set previously. If you manually change the instance count, the autoscale engine scales back to the minimum or the maximum based on the values set up while updating autoscaling settings. To sustain the changes, you will have to reset the autoscale rules as well.
Always Set Up Both Values
Always use the combination of scale-out and scale-in rules to ensure the addition as well as the removal of resources. If you define only the minimum value or the maximum value, autoscaling will take place in a single direction. For optimal use of resources and minimizing costs, you want both allocation and de-allocation of resources.
Choose the Right Statistic for Diagnostic Metrics
While creating diagnostic metrics, it is essential to choose the appropriate statistics. Any of the Minimum, Maximum, Average, and Total can be chosen as a metric to scale by. However, the Average is the most common statistic.
Choose the Metric Thresholds Carefully
It is important to choose the thresholds attentively for all metric types. The best practice is to choose different thresholds for scale-in and scale-out based on practical scenarios. Impractical selection of thresholds can lead autoscaling to behave in a way that may seem confusing.
Take Precautions while Configuring Multiple Profiles
There are various ways to set up a profile in the autoscale settings. You can set up a default profile that doesn’t depend on any schedule or time. You can also set up a recurring profile or a profile that takes date and time values and can be configured for a fixed period.
When autoscaling takes place, the autoscale engine always checks for a profile in the following order.
- Fixed Date Profile
- Recurring Profile
- Default Profile
Autoscale processes only one profile at a time. If a profile condition is met, the autoscale engine doesn’t check the profile condition below it. If you want to include certain conditions from the next profile in the order, you must include them in the current profile.
Always Choose a Safe Default Instance Count
When metrics are not specified, autoscaling scales your Azure App Service to the default instance count. Thus, the default instance count is important and should be selected to the level suitable for your workload.
Deploy Azure App Service Environment with Apps4Rent
Although Azure App Service helps organizations solve crucial problems associated with scalability and security, it requires intensive care to keep the costs minimum. Therefore, you will need professionals highly skilled in Azure cloud architecture for the successful deployment of the service. With a Microsoft CSP such as Apps4Rent, you get a robust team of Azure hosting experts for seamless implementation of Azure App Service. Our hosting experts are available 24/7 via phone, chat, and email for Azure plan inquiries.
Looking for help with Azure?
Our Azure experts can help you.