1. Home
  2. Training Library
  3. Alibaba Cloud
  4. Courses
  5. Using Auto Scaling to Support Your Alibaba Cloud Workloads

Auto Scaling Concepts

Contents

keyboard_tab
Start course
Overview
Difficulty
Intermediate
Duration
49m
Students
22
Ratings
5/5
starstarstarstarstar
Description

This course explores Alibaba Auto Scaling. We'll look at the main applications of the Auto Scaling service and you'll follow along with practical demonstrations direct from the Alibaba Cloud platform to learn how to use each auto scaling service.

Learning Objectives

  • Get a basic understanding of Alibaba Auto Scaling
  • Learn about key auto scaling concepts
  • Understand the core functions of auto scaling, including scaling group,s scaling configurations, and scaling rules
  • Learn how to trigger scaling manually and how to create triggers for automatic scaling events

Intended Audience

This course is intended for anyone looking to use auto scaling to manage their Alibaba Cloud workloads, as well as anyone studying for the ACP Cloud Computing certification exam.

Prerequisites

To get the most out of this course, you should have a basic understanding of the Alibaba Cloud platform.

Transcript

Hello, and welcome back. Let's now take a look at some of Auto Scaling's core concepts. Auto Scaling supports the following key functions, Scaling Operations, Server Load Balancer auto-configuration, and RDS database whitelist auto-configuration. There are two types of scaling operations that are supported. Scheduled scaling and dynamic scaling. With scheduled scaling, you tell Auto Scaling to perform a scaling operation at a specific time. For example, scale up to X instances at 1:00 PM every day. Now this type of scaling operation is designed for cases where you can predict that you will have a jump in demand.

Dynamic scaling on the other hand is for scenarios where you can not predict in advance what the load will be on your platform. In that case, you can scale up and down dynamically based on cloud monitor metrics, such as CPU, network, or memory usage. In order to make full use of the Auto Scaling service, you of course need to be familiar with some of the core terminology associated with Auto Scaling.

The first term to know is Auto Scaling itself. This refers to the entire Alibaba Cloud Auto Scaling Service. Within Auto Scaling there are some related concepts that are also important to know. The first is Scaling Group. A scaling group is a collection of ECS instances with a similar configuration. So similar memory network operating system that are deployed in an application scenario, so that are deployed together to say, serve a website or serve as a web application backend.

The Scaling Group defines the maximum and minimum number of ECS instances that the group can contain. And also any associated Server Load Balancer and RDS database configuration. Within a Scaling Group, you will have what's called a Scaling Configuration. A Scaling Configuration defines the configuration information for the ECS instances in the Scaling Group. Next, there are Scaling Rules. A scaling rule defines specific scaling actions. For instance, adding or removing ECS instances.

We also have Scaling Activities. This is what happens when a scaling rule is successfully triggered. A scaling activity is generated, and it is the Scaling Activity that actually adds or removes ECS instances from the Scaling Group. Then there is the Scaling Trigger Task. This is a task that triggers a scaling rule, such as a scheduled task that you've set up yourself or a Cloud Monitor alert. Finally, we have Cool-down Period, the cool-down period or cool-down time refers to a period during which Auto Scaling cannot execute new scaling activities.

Each time a scaling activity is triggered, a cool-down period is entered during which new activities cannot take place. This is to keep the group from growing or shrinking too quickly. Usage of the Auto Scaling Service usually follows this pattern. There are six steps. First you create a Scaling Group and configure the minimum and maximum number of ECS instances that the group can hold. And you associate a Server Load Balancer and maybe an RDS database with the group.

Second, you create a scaling configuration. You choose the attributes for the ECS instances that Auto Scaling will add or remove from the group, such as the operating system, image ID, an instance type, or a family. In step three, you enable the Scaling Group with the scaling configuration you created in step two. In step four, you create a scaling rule. For example, add an ECS instances. In steps five and six, you create either a scheduled task or a Cloud Monitor alarm task that will trigger the scaling rule that you created in step four.

To recap, a Scaling Group includes a Scaling Configuration, Scaling Rules, and Scaling Activities. Removing a Scaling Group, also deletes the Scaling Configuration, Scaling Rules, and Scaling Activities associated with the Scaling Group. Scaling Trigger tasks fall into two categories, Scheduled Tasks and Cloud Monitor Alert Tasks. Tasks themselves are independent of the Scaling Group. If you delete the Scaling Group, the Scheduled Tasks and Cloud Monitor Alert Tasks will remain.

When configuring Auto Scaling, you need to take into account the following considerations. First, for Scaling Rules. Scaling Rules can automatically adjust the number of ECS instances, according to the max size and min size value set for the Scaling Group, which means they cannot exceed those limits. For example, if the number of ECS instances is set to 50 in the scaling rule, but the max size value of the scaling group is set to 45, then the Scaling Group will only be able to grow the group up to 45 instances, because that is the maximum upper limit on the size of the group that's set in the Scaling Group Configuration.

Cool-down Time. The cool-down time starts after the last ECS instance is added or removed from the Scaling Group by a Scaling Activity. During the cool-down period only Scaling Activity requests from Cloud Monitor alarm tasks are rejected by the Scaling Group. This is an important point I didn't mention earlier. Other tasks, that means manually executed scaling rules and scheduled tasks can immediately trigger a scaling activity without waiting for the cool-down time to expire. So scheduled and manual scaling tasks can take place during the cool-down period.

Scaling Activities. Only one scaling activity can be executed at a time in a Scaling Group. A Scaling Activity cannot be interrupted. For example, if a scaling activity to add 20 ECS instances is being executed, it can not be forced to terminate when only five instances have been created. When a scaling activity fails to add or remove ECS instances to or from a scaling group, the system maintains the integrity of the ECS instances rather than the Scaling Activity. That is, the system rolls back the failed ECS instances.

It does not roll back the Scaling Activity. For example, if the system has created 20 ECS instances for the Scaling Group, but only 19 of them are successfully added to the Server Load Balancer, then the system will only release the one failed ECS instance. It will not roll back the other 19. Since Auto Scaling uses Alibaba Cloud's Resource Access Management or RAM in order to replace ECS instances through the ECS API, the rollback ECS instance will still incur a cost for the time it was running.

Scaling Rules can automatically adjust the number of ECS instances in accordance with the MaxSize and MinSize limits set for the Scaling Group. Billing for Auto Scaling Services is very simple. Auto Scaling Service itself is free. You pay only for the ECS instances that Auto Scaling Service automatically creates for you. Note that you will still be charged for Pay-As-You-Go instances even if they are stopped. So in order to avoid further fees, you should probably configure your Auto Scaling Group to release unused instances. Next, we'll take a look at how to create and manage Scaling Groups.

About the Author
Students
374
Courses
18
Learning Paths
2

Alibaba Cloud, founded in 2009, is a global leader in cloud computing and artificial intelligence, providing services to thousands of enterprises, developers, and governments organizations in more than 200 countries and regions. Committed to the success of its customers, Alibaba Cloud provides reliable and secure cloud computing and data processing capabilities as a part of its online solutions.