• Service to scale up the EC2 capacity automatically by scaling out or in as per defined criteria.
  • Number of running EC2 instances increases during demand spikes by it
  • Number of running EC2 instances decreases automatically during demand lulls or troughs to minimize costs.
  • Auto Scaling Plans
    • Maintaining Current Instance Levels: hold a minimum or specified number of running instances of current level, at all times. periodic health check is run on instances within an Auto Scaling group. If an unhealthy instance is found, it is terminated and new one launched.
    • Manual Scaling: most basic methods. User specify the change in the maximum, minimum, or desired capacity of the Scaling group. creating or terminating instances to maintain the updated capacity is done by auto scaling .
    • Scheduled Scaling: Scale as per a predictable schedule like end-of-month, end-of-quarter, or end-of-year processing. Scale as per recurring events. Scaling performed automatically as a function of time and date.
    • Dynamic Scaling: Scaling related parameters defined in a scaling policy like add instances to web tier if network bandwidth reaches a threshold.

Launch Configuration

  • template that Auto Scaling uses to create new instances,
  • composed of
    • configuration name
    • Amazon Machine Image (AMI)
    • EC2 instance type
    • security group
    • instance key pair.
  • each group can have only one launch configuration at a time.
  • CLI commands can also create a launch configuration with the given attributes
  • default limit for launch configurations is 100 per region.
  • For exceeding the limit, call to create-launch-configuration tends will fail.
  • auto scaling may lead to reach limits of other services hence, consider all AWS services

Auto Scaling Group

  • collection of EC2 instances managed by Auto Scaling service.
  • each group contains configuration options that control when Auto Scaling should launch new instances and terminate existing instances.
  • group must have
    • a name
    • a minimum and maximum number of instances in group.
  • optionally specify desired capacity or number of instances group must hold at all times.
  • default desired capacity indicates minimum number of instances that are being specified.
  • CLI command can also create an Auto Scaling group

Scaling Policy

  • a set of instructions that helps to decide Auto Scaling whether to scale out or in
  • connect CloudWatch alarms with an Auto Scaling group so as to dynamically adjust Auto Scaling.
  • scale out is, launching new EC2 instances as per launch configuration
  • scale in, terminate instances
  • configure scaling policy by
    • By increasing or decreasing by a specific number of instances, such as adding two instances
    • We can target a specific number of instances, such as a maximum of five total Amazon EC2 instances; or we can adjust based on a percentage.
    • We can also scale by steps and increase or decrease the current capacity of the group based on a set of scaling adjustments that vary based on the size of the alarm threshold trigger.
Menu