Table of Contents
There is a growing need for businesses, that the applications they are hosting should be capable of handling peaks in workloads, services such as video streaming where there could be a sudden surge of unpredictable traffic, or an online gaming where there are regular peak hours every day. This raises the question of how to scale resources as the demand peaks or decrease it during off peak hours.
In this article we will learn more about Alibaba Auto Scaling service, its features, advantages and use cases etc.
What is Alibaba Auto Scaling?
Alibaba Auto Scaling is a management service which allows users to automatically adjust elastic computing resources based on their business policies and needs. There are multiple modes of scaling in Alibaba cloud. We will look more in detail about them.
Modes of Scaling in Alibaba Cloud
- Elastic Scale out – adds additional computing resources to pool where there are peak timings
- Elastic Scale in – release Elastic computing resources when demands come down
- Elastic Self-healing – when an unhealthy elastic computing resource instance is detected it is replaced by new one automatically
Scaling options can be scheduled or could be dynamic in operation or fixed mode. In scheduled scaling you can define a scaling operation at a specific time slot for example, scale up x instances at 2:00 PM every day.
In dynamic scaling based on cloud monitor metrics (such as CPU usage, network , memory usage) dynamically scale up and down. It supports server load balancer auto configuration and RDS access whitelist auto-configuration. In Fixed mode scaling minimal size setting lets you deploy minimum number of ECS instances required to support business usual level of activity.
How to set up Auto Scaling?
Step 1: Create a scaling group, configure minimum and maximum number of ECS instances in scaling group and choose the associated server load balancer and RDS instance
Step 2: create scaling configuration: configure the ECS instance attributes for auto scaling such as image ID and instance type
Step 3: enable scaling group with scaling configuration as in step 2
Step 4: create scaling rule such as example add X instances
Step 5: create a scheduled task. Trigger scaling rule at 12 noon
Step 6: create an alarm task (CloudMonitor API PutAlarmRule) for example add 1 ECS instance when the average , CPU usage is more than or equal to 80%
Auto Scaling Considerations
Scaling group comprises scaling configuration, scaling rule and scaling activities.
- When the scaling group is removed it deletes scaling configuration, scaling rule and scaling activities associated with it. Scaling tasks are independent of the scaling group.
- Scaling rules automatically adjust instance number as per MaxSize value and MinSize value of scaling group.
- During the cool down period only scaling activity requests from CloudMonitor alarm tasks are rejected by the scaling group. Cool down period starts after the last ECS instance addition/removal is done from scaling group by scaling activity
- Only one scaling activity can be executed at a time in auto scaling group
- Scaling activity can’t be interrupted
- If scaling activity fails to add or remove ECS instances to and from scaling group the system maintains the integrity of ECS rather than scaling activity
- Auto scaling uses Alibaba cloud’s resource Access management (RAM) service to replace ECS instances through ECS API, the rolled back ECS instance will still incur charge for the time they were running
Features of Auto Scaling
- On demand – Auto scaling of resources on demand to respond to peak traffic spikes in real time without the need for prediction of demand changes
- Automatic – automatic creation and release of ECS instances without any manual intervention and auto configuration of SLB instances and whitelisting of ApsaraDB for RDS instances
- Flexible – schedule , customize, and fix the minimum number of instances and auto configuration replacement for unhealthy ECS instances can be achieved. It also offers API operations to allow to monitor instances using external monitoring systems
- Intelligent – intelligently schedules cloud computing resources based on complexity of scenarios
Use cases for Auto Scaling
- Video streaming services
- Live streaming and broadcast
- Online gaming
- E-commerce websites