From the course: AWS: Automation and Optimization

Auto Scaling - Amazon Web Services (AWS) Tutorial

From the course: AWS: Automation and Optimization

Start my 1-month free trial

Auto Scaling

- [Instructor] Amazon EC2 Auto Scaling is a service that helps you optimize the performance of your applications while lowering infrastructure costs by easily and safely scaling multiple AWS resources. It allows you to maintain the right number of EC2 instances to handle the load for your application. Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost. Let's consider an example of a website that sales t-shirts. The website is hosted on a web server that runs on Amazon EC2. The website is served from two EC2 instances for high availability reasons. And for load balancing, both EC2 instances are registered behind a load balancer. The website sees normal traffic during weekdays, Monday to Friday, and the average CP utilization is around 60%. However, on weekends, Saturdays and Sundays, the website sees an increased number of sales. The CP utilization reaches a peak of 95%. If it touches 100% there is chance that traffic may get dropped, leading to loss of business. One way to handle the situation is to manually add more EC2 instances to handle the increased load during weekends. While this may solve the problem, there are a few disadvantages to this approach. Since it is a manual approach, it is prone to errors. Let's say we add two EC2 instances, and again the CP reaches a high. We'll have to manually add more EC2 instances. It is possible that after we add more EC2 instances, the incoming traffic reduces, and stays that way. Now, we are adding to our costs. There is a chance that the traffic spike may happen during weekdays, as well. So, we'll have to continuously monitor the CP utilization to handle such situations. Auto Scaling addresses this problem by automating the whole process of monitoring your EC2 instances, and adding or removing based on configured thresholds. Auto Scaling also registers newly added instances behind and existing load balancer. Auto Scaling provides better fault tolerance, better availability, and lower costs, and is a good choice for applications that use one or more scalable resources, and experience variable load. Auto Scaling allows you to specify the minimum, maximum, and desired capacity. Auto Scaling ensures that your group never goes below the minimum size and above the maximum size. Specifying the desired capacity ensures that your group has that many instances. An Auto Scaling group can contain EC2 instances in one or more availability zones within the same region. Allowing you to take advantage of the safety and reliability of geographic redundancy of multiple availability zones in a region. When one availability zone becomes unhealthy or unavailable, Auto Scaling launches new instances in the unaffected availability zone. When the unhealthy availability zone returns to a healthy state, Auto Scaling automatically redistributes the instances evenly across all of the designated availability zones. An Auto Scaling group cannot span multiple regions.

Contents