AWS Autoscaling

One can always provide high Quality of service (QoS) by over provisioning resources in order to account for most variability in the load or failure scenarios, however cost, and the ability to compete on the cost of the service, becomes an issue.

Elastic Load Balancer

  • The Elastic Load Balancer acts as a network router that will forward incoming requests to multiple EC2 Instances sitting behind it in a round-robin fashion.

  • The Instances that ELB points to can be added

    • manually through the web console,
    • programmatically through an API, or
    • dynamically with an Auto Scaling Group (ASG) which in AWS defines a pool of instances.
  • ELB also does a Health Check to see if an instance is alive (if not, it will stop sending requests to it).

Amazon Auto Scaling

The AWS Auto Scaling service automatically adds or removes computing resources allocated to an application by responding to changes in demand.

AWS Auto Scaling refers to horizontal scaling, which is the act of increasing or decreasing the compute capacity of an application by changing the number of servers assigned to it.

  • This is in contrast to vertical scaling, which is achieved by changing the size of individual servers in response to demand (such as changing m1.small to m1.large).
    • AWS Auto Scaling offers the functionality to monitor and add or remove identical resources (horizontal scaling).
    • Amazon Auto Scaling can be accessed through command-line tools or through APIs in the SDK.
  • Amazon's Auto Scaling provides the following deployment modes on a group of EC2 instances:

    • Maintain a fixed number of running EC2 instances at all times, by performing periodic health checks on instances and automatically launching new instances when one or more are unhealthy;
    • Scale instances by invoking Auto Scaling manually, which will increase or decrease the number of running instances on your behalf;
    • Predictable scaling based on a developer-specified schedule (for example, a condition you could specify to decrease the servers every Friday at 5pm and to increase them every Monday at 8am);
    • Dynamically scale based on conditions specified by the developer (for example, CPU utilization of your EC2 instances).

Using Elastic Load Balancing and Auto Scaling

AWS Auto Scaling Internals

Using Amazon's Auto Scaling in a dynamic fashion requires, at minimum, the following:

  • An Auto Scaling group should be defined with minimum, maximum and desired number of instances defined during the group creation. More information can be found on AWS about creating auto scaling groups. A Launch Configuration template should be defined, which includes the AMI ID, instance types, key pairs and security group information, among others. As Auto Scaling is meant to scale automatically based on application demands; i.e. the instance should be configured to automatically start the required application services and work seamlessly on launch. An Auto Scaling policy should be created, which defines the set of actions to perform when an event, such as a CloudWatch alarm, is triggered.

Amazon CloudWatch

  • Amazon CloudWatch enables developers to monitor various facets of their AWS resources. Developers can use it to collect and track metrics from various AWS resources that are running on the AWS cloud.
  • Using APIs, CloudWatch also allows you to programmatically retrieve monitoring data, which can be used to track resources, spot trends and take automated action based on the state of your cloud resources on AWS. * CloudWatch also allows you to set alarms, which constitute a set of instructions to be followed in case of an event that is tracked by CloudWatch is triggered.

  • CloudWatch can be used to monitor various types of AWS resources including:

  • EC2 instances

    • For EC2 instances, CloudWatch allows you to monitor CPU, memory and disk utilization.
  • EBS volumes
  • EMR job flows etc
  • ELB Loads

results matching ""

    No results matching ""