AWS Certification : High availability of EC2 instances using AutoScaling

Are you preparing for AWS Certified SysOps Administrator – Associate certification exam?  Are you ready to pass this exam? In this blog, we are writing a series of articles on topics which are covered in the AWS certified SysOps associate certification exam. You can subscribe to us for receiving further updates on this topic.

The SysOps Associate certification exam is the hardest exam in the associate level. We would recommend you pass both solution architect associated certification exam and developer associated certification exam first before of taking take this exam.

The AWS Certified SysOps Administrator – Associate exam validates technical expertise in deployment, management, and operations on the AWS platform.

The AWS SysOps Administrator – Associate Level exam validates the candidate’s ability to:

  • Deliver the stability and scalability needed by a business on AWS
  • Provision systems, services and deployment automation on AWS
  • Ensure data integrity and data security on AWS technology
  • Provide guidance on AWS best practices
  • Understand and monitor metrics on AWS
Domains covered at the AWS Certified SysOps associate exam

Figure #0.  Domains covered at the AWS Certified SysOps associate exam

You can download the related AWS Certified SysOps Administrator – Associate Level Exam Blueprint for more detail about it.

In this article, we are going to explain about the topic that addresses the scalability and elasticity of EC2 instances as highlighted in the AWS Blueprint from the above exam guide.

Context

Almost every day and depending of our company needs, we must maintain the availability and elasticity required into our infrastructure services, permitting that it scales up or down automatically according to some conditions that we define, contributing to improve their performance or reduce their cost.

What is Auto Scaling?

Auto Scaling is a fully managed service designed to launch or terminate Amazon EC2 instances automatically to help ensure you have the adequate number instances available for handling your application’s load.

Auto Scaling detects impaired EC2 instances and unhealthy applications, and replace the instances without your intervention, this service scales your EC2 capacity up or down according to conditions defined. This ensures that your application is getting the compute capacity that you expect, maintain performance and decrease capacity during low demand to reduce costs.

As SysOps administrator, you can reduce the need to manually provision Amazon EC2 capacity in advance if you use Auto Scaling features.

Benefits of Auto Scaling

When you use Auto Scaling, your applications gain the following benefits:

  • Better fault tolerance: Auto Scaling can detect when an instance is unhealthy, terminate it, and launch an instance to replace it. Maintain a fixed group size or adjust dynamically based on Amazon Cloud Watch
  • Better availability: Auto Scaling can help you ensure that your application always has the right amount of capacity to handle the current traffic demands. Keep your Auto Scaling group healthy and balanced.
  • Better cost management: Auto Scaling can dynamically increase and decrease capacity as needed. You just pay for the EC2 instances that you use.
  • Reusable Instance Templates: Provision instances based on a reusable template you define, called a launch configuration

Creating Auto Scaling Groups

You create collections of EC2 instances, called Auto Scaling groups, and define the limits of group size:

  • Minimum size: lower limit of number instances into the group size
  • Maximum size: higher limit of number instances into the group size
  • Desired capacity: number of instances should be running into a specific time
Auto Scaling group size limits

 Figure #1. Auto Scaling group size limits

 

To create an Auto Scaling group, you will first need to choose a template that your Auto Scaling group will use when it launches instances for you, called a launch configuration. Choose a launch configuration or create a new one, and then apply it to your group.

Step 1: Create launch configuration

First, define a template that your Auto Scaling group will use to launch instances. You can change your group’s launch configuration at any time.

Creating a Launch Configuration into an Auto Scaling Group

Figure #2.  Creating a Launch Configuration into an Auto Scaling Group

Step 2: Create Auto Scaling group

Next, give your group a name and specify how many instances you want to run in it.

Creating an Auto Scaling Group

Figure #3.  Creating an Auto Scaling Group

Your group will maintain this number of instances and replace any that become unhealthy or impaired.
You can also use Amazon CloudWatch to send alarms to trigger scaling activities and Elastic Load Balancing (ELB) to distribute traffic to your instances within Auto Scaling groups. If you have predictable load changes, you can set a schedule through Auto Scaling to plan your scaling activities, avoid create schedules that make conflict.

Creating a Scheduled Action for Auto Scaling Group

Figure #4.  Creating a Scheduled Action for Auto Scaling Group

Auto Scaling enables you to take advantage of the safety and reliability of geographic redundancy by spanning Auto Scaling groups across multiple Availability Zones within a region. When one Availability Zone becomes unhealthy or unavailable, Auto Scaling launches new instances in an unaffected Availability Zone.

Balancing resources across Availability Zones is a best practice for well-architected applications, as this greatly increases aggregate system availability. Auto Scaling automatically balances EC2 instances across zones when you configure multiple zones in your Auto Scaling group settings.

Auto Scaling Group Lifecycle

 The lifecycle starts when the Auto Scaling group launches an instance and puts it into service. The lifecycle ends when you terminate the instance, or the Auto Scaling group takes the instance out of service and terminates it.

The complete lifecycle of instances in an Auto Scaling group

Figure #5.  The complete lifecycle of instances in an Auto Scaling group

You can add a lifecycle hook to your Auto Scaling group so that you can perform custom actions when instances launch or terminate. Adding lifecycle hooks to your Auto Scaling group gives you greater control over how instances launch and terminate. For example, you could install or configure software on newly launched instances, or download log files from an instance before it terminates.

Detecting “Unhealthy” instances

An unhealthy instance is one where the hardware has become impaired for some reason (bad disk, etc.), or it is not passing a user-configured ELB health check. Auto Scaling performs health checks on each individual EC2 instance at regular intervals, and if the instance is connected to an Elastic Load Balancing load balancer, it can also perform ELB health checks.

An Unhealthy instance into the Auto Scaling Group

Figure #6.  An Unhealthy instance into the Auto Scaling Group

Auto Scaling might suspend processes for Auto Scaling groups that repeatedly fail to launch instances. This is known as an administrative suspension, and most commonly applies to Auto Scaling groups that have been trying to launch instances for over 24 hours but have not succeeded in launching any instances.

Distributing traffic between EC2 instances

To use a load balancer with your Auto Scaling group, create the load balancer and then attach it to the group.

If you are preparing for the AWS associate certifications exam and looking for any help, please send us a mail to call our customer support team. And Benchmark your AWS knowledge with one or more of the highly demanded AWS Foundation certifications.

Important Points to Remember for the AWS Certified SysOps Administrator – Associate Certification exam

  • Auto Scaling is a web service designed to launch or terminate Amazon EC2 instances automatically based on user-defined policies, schedules, and health checks
  • Some benefits for using Auto Scaling: Automated provisioning, adjustable capacity, and reusable instance templates.
  • There are no additional fees with Auto Scaling
  • You could enable CloudWatch detailed monitoring when creating a launch configuration
  • Auto Scaling performs health checks per EC2 instance at regular intervals or by an ELB health check configured
  • You should span your Auto Scaling groups across multiple Availability Zones within a region to obtain more safety and reliability, it’s a best practice
  • The Auto Scaling group has a lifecycle and you can add Auto Scaling lifecycle hooks to perform custom actions
  • You can set a schedule through Auto Scaling to plan your scaling activities, please avoid schedules that make conflict

Glossary

Term Brief description
Auto Scaling group An Auto Scaling group contains a collection of EC2 instances that share similar characteristics and are treated as a logical grouping for the purposes of instance scaling and management 
Launch configuration A launch configuration is a template that an Auto Scaling group uses to launch EC2 instances. When you create a launch configuration, you specify information for the instances such as the ID of the Amazon Machine Image (AMI), the instance type, a key pair, one or more security groups, and a block device mapping. 
Scaling plans scaling plan tells Auto Scaling when and how to scale. For example, you can base a scaling plan on the occurrence of specified conditions (dynamic scaling) or on a schedule. 
Fleet management Fleet management refers to the functionality that automatically replaces unhealthy instances and maintains your fleet at the desired capacity 
Dynamic scaling The dynamic scaling capabilities of Auto Scaling refers to the functionality that automatically increases or decreases capacity based on load or other metrics 
Scaling policy A scaling policy is a set of instructions for making such adjustments in response to an Amazon CloudWatch alarm that you assign to it. In each policy, you can choose to add or remove a specific number of instances or a percentage of the existing group size, or you can set the group to an exact size 
Desired capacity The number of EC2 instances that the group should have at any time, also called desired capacity

 

Summary

In this article, we have explained about how to maintain the availability and elasticity of EC2 instances using Auto Scaling service, the auto scaling lifecycle and distributing traffic between instances using load balancing.

References:

[1] Auto Scaling Faqs, https://aws.amazon.com/autoscaling/faqs/
[2] Amazon Auto Scaling Documentation,
https://aws.amazon.com/documentation/autoscaling/
[3] AWS Certified SysOps Administrator – Associate Certification.
https://aws.amazon.com/certification/certified-sysops-admin-associate/

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

Leave a Comment

Scroll to Top
vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |