AWS Scheduled Autoscaling

AUTOSCALE SETUP
There are 3 steps
1.Create Autoscale Launch Configuration
2.Create Autoscale Group
3.Create Autoscale Policy

Creating Launch Configuration:

#as-create-launch-config unni-autoscale –image-id ami-5766173e –region us-east-1 –instance-type t1.micro –key unni –group unni

Verify Lauch Configuration:

#as-describe-launch-configs –region us-east-1

Creating Autoscaling Group

#as-create-auto-scaling-group unni-autoscale-test –launch-configuration unni-autoscale –region us-east-1 –availability-zones us-east-1a –min-size 1 –max-size 3 –load-balancers unni-autoscale

Verify Autoscaling Group

#as-describe-auto-scaling-groups unni-autoscale-test –headers –region us-east-1

Autoscale Policy has 3 Options
1.Maintain a fixed number of instances
2.Scale UP and Down based on the demand
3.Scale UP and Down based on schedule

SCALE UP AND DOWN BASED ON SCHEDULE

CHECKING MY AUTOSCALE SETUP OVERALL
#as-describe-auto-scaling-groups unni-autoscale-test –headers –region us-east-1
#as-describe-policies –headers
#as-describe-launch-configs
#as-describe-scheduled-actions –headers
#as-describe-scheduled-actions scale-down-schedule –headers –region us-east-1

Auto Scaling supports only the future date and time. The expected format is “YYYY-MM-DDThh:mm:ssZ” in UTC/GMT time zone only.

Scale Up Cron
Cron Task : 30 1 1-31 1-12 1,2,3

#as-put-scheduled-update-group-action scale-up-schedule –auto-scaling-group unni-autoscale-test –recurrence “30 15 1-31 1-12 1,2,3” –desired-capacity 2 –region us-east-1

Scale Down Cron

#as-put-scheduled-update-group-action scale-down-schedule –auto-scaling-group unni-autoscale-test –recurrence “30 17 1-31 1-12 1,2,3” –desired-capacity 1 –region us-east-1

The above cron-task will create a instance at 9pm IST and terminate it at 11pm IST.
We can control the number of instances by controlling the desired-capacity variable.

Reference
http://www.newvem.com/how-to-configure-aws-cloud-auto-scaling-to-scale-based-on-a-schedule/
http://alestic.com/2011/11/ec2-schedule-instance

http://www.newvem.com/9-guidlines-for-scheduling-aws-ec2-instances/

Netflix on AWS

hlg

DC Analogy

DC

Cloud Analogy

cloudana

Transition : DC to CLOUD

transition

Application Restructuring

apprest

DATABASE

db

Test Cloud Efficiency  

Monkey

There are Chaos Monkey (which simulates instance failures) and Chaos Gorilla (which simulate AWS Region Failures).

Extensive Backup Strategy

database

As shown on the left side, the whole infra setup is redundant across multiple AZ. On the right side the production data availability is shown in 3 different levels.

1st Level – Each data element is stored redundant database to protect against hardware failure.
2nd Level – To protect from logical failure like software bugs, someone drops a column accidently etc the need occurs to take regular backup of data onto s3.
3rd Level – To protect against natural disasters, catastrophic security breaches there is a secondary backup of all customer data into a hetrogenous cloud environment.

source