Implementing autoscaling rules and patterns

Autoscaling offers a solution to match performance requirements and meet SLAs for Azure resources and applications. It can add additional resources, such as adding VMs and CPUs to VMs and other Azure resources, and when those resources are no longer needed, they can be removed to minimize costs. 

Autoscaling is one of the key benefits of cloud technologies because you add and remove additional resources easily and even automatically without the need to manage those resources. Autoscaling can be done in the following two different ways:

  • Vertical scaling: This is also called scaling up and down. You can move applications to a different VM size. By changing the VM size, applications become unavailable for a short period of time, so this type of scaling is normally not executed automatically.
  • Horizontal scaling: This is also referred to as scaling in and out. You scale horizontally when you add additional resources, such as adding or removing containers to Azure Container Services for instance. This type of scaling is mostly done automatically because it doesn't require resources to become unavailable.

To design an effective autoscaling strategy, you can use the following approaches and services:

  • Monitoring and alerting: Use the monitoring and alerting capabilities that are available from the different monitoring solutions in Azure. Next to the monitoring solutions, different Azure resources offer autoscaling as well, such as virtual machines, Azure Service Fabric, Azure Functions, Azure App Service, and other cloud services. These resources can be configured from the setting pages in the Azure portal.
  • Decision-making logic: Make use of decision-making logic that helps to decide whether a resource needs to be scaled. This can be done dynamically inside Azure Logic Apps by calling automation runbooks or by using predefined schedules at times where the system is heavily used.
  • Azure monitoring scale: This is a service integrated in Azure Monitor that offers autoscaling for VMs, VM scale sets, Azure App Services, and Azure Cloud Services. You can use this to schedule instances, scale-out when a certain CPU usage is met, and when a certain number of messages are added to a queue. Azure Monitor is covered in more detail in the next section. 
  • Application architectures: Architect custom applications accordingly, so that they can be scaled horizontally. This applies to Azure Service Fabric applications, applications that run inside containers, applications that run on Kubernetes clusters, or batch applications. For this, the throttling pattern and the competing consumers pattern can be used. Code that addresses singleton application instances can be used for this as well. Application design considerations are covered in more detail later in this chapter.

In the next section, we are going to cover Azure Monitor autoscaling.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.217.194