15619 Project2.1 Guide

Project2.1 Horizontal Scaling and Advanced Resource Scaling

Goal: Using APIs to programatically control AWS Load Balancer and Auto Scaling Group.

Workflow

  1. Create working instances
  2. Create an elastic load balancer LB1: set up health check page
  3. Create an auto-scaling launch configuration
  4. Create an auto-scaling group: attach the ELB just created (advanced - load balancing) and use the same subnet

Elastic Load Balancer

Elastic Load Balancer automatically divides traffic to connected instances and handles instance failures by doing health checks. The default distribution strategy is Round-Robin. If an instance is unhealthy, it will stop routing requests to it.

Auto Scaling Group

Auto Scaling Group automatically adds or removes identical resources by responding to changes in demands.

Auto Scaling Policy: Auto Scaling Group reacts when user-specified threadhols(i.e. CPU utilization) are triggered(by CloudWatch). It maintains a desired number(between specified minium and maximum) of instances at all times. It can also scale based on specific schedule(i.e. more server during the weekend). Auto Scaling Group does health checks as well. If an instance is unhealthy, it will launch new instances to replace them.

Auto Scaling Template: instance AMI, instance type, key pairs, security group, etc. The applications in the instances should run automatically when the instances are up.

Tips

  1. The auto-generated instances will NOT be tagged if you terminate it too soon after you launched them!