SlideShare a Scribd company logo
1 of 29
Auto Scaling Spot Instances with
Custom CloudWatch Metrics
AWS Singapore User Group
Chris Drumgoole
Head, Product Management
Agenda
• Quick overview of VSocial
• Infrastructure Scaling Needs
• Overview of EC2 Auto Scaling with AWS
– Scaling from CloudWatch

• Configuring Auto Scaling Launch
Configs, Groups, and Policies
• Creating your own CloudWatch Metric
• Bringing it all together

2
OVERVIEW
VSocial Overview
• “Social Media Enterprise Command Center”
• Core Features:
– Social CRM
– Social Media Community Management

• Community Managers use tool to manage FB and
TW communities
• Tool helps manage conversations from multiple
Social Media accounts
A glance at the infrastructure…
Database Cluster

This needs to scale!
Front-End Application
Server Cluster
Data Pull
Data Pull

AWS SQS

Data Pull
Data Pull

AWS
SNS

Data Pull
Data Pull

Load Balancer

Public Visitors
Infrastructure Scaling Needs
• Timely Conversation Data Pulls from Social Networks
• Data Pull Processes can take longer due to:
– Increased activity on channel (more tweets or FB
Messages)
– Network Latency

• Slowdowns will cascade across all requests
Requirement:

Way to automatically adjust compute resources when
needed based on real-time performance data, 24/7
SOLUTION
Introducing Auto Scaling (EC2)
• AWS allows two types of Auto Scaling:
– Minimal Configuration and Management directly from a
CloudWatch Alarm
– More advanced via SDK

• AWS Supports auto scaling On-Demand or Spot
Instances, depending on needs
Spot Instances vs. On Demand Instances
• Bidding System
• Considerably cheaper than On Demand*
– Micro Instances:
• On Demand Pricing @ $0.02/hr  ~$14.40/mth
• Spot Pricing @ >$0.004/hr  ~$2.88/mth

– Small Instances:
• On Demand Pricing @ $0.08/hr  ~$57.60/mth
• Spot Pricing @ >$0.01/hr  ~$7.20/mth

• Spot Instances not guaranteed
• Great for non-mission critical tasks
* All prices in USD for resources in the Asia Pacific Singapore Region
Spot Instances and Our Needs
• We need to be able to scale up data pull instances
so we can keep up with volume (and mitigate
slowdowns)
• It’s ok if the machine are taken away from us, we’ll
just request more.
• Cost Savings is essential
AWS-Managed Scaling with CloudWatch
SETTING UP AUTO SCALING
Configuring Auto Scaling
Before you can finish setting up the CloudWatch Auto
Scaling, you need to follow these steps:
1.
2.
3.
4.

Install the AWS CLI tools on your trusty Linux box
Create an Auto Scaling Launch Config
Create an Auto Scaling Group
Create Scale Out (Up) and In (Down) Policies
Configuring Auto Scaling:
Launch Configurations
Defines the type of
Instance to create
• Create an AMI
• Launch Config links to
an AMI
• Define Instance Type
• Define max bid price
(in USD, /hr)
• Turn off Monitoring!

$as-create-launch-config 
MyLaunchConfigName 
--image-id ami-123ab456 
--instance-type t1.micro 
--spot-price 0.025 
--key our_key_name 
--monitoring-disabled
Configuring Auto Scaling:
Scaling Groups
• Create a Load
Balancer to “hold”
these launch configs
• State what AZ zones
you want these to be
launched in
• # Instances Lower and
Upper bounds
• Meta Configuration
• Link to the Launch
Configuration

$as-create-auto-scaling-group 
MyASGroupName 
--availability-zones apsoutheast-1a,ap-southeast-1b 
--default-cooldown 120 
--load-balancers VSocialCrons

--min-size 1 
--max-size 45 
--tag="k=Name, v=SQSProcessor, p=true" 
--launch-configuration
MyLaunchConfigName
Configuring Auto Scaling:
Policies
• Need both Up and
Down policies
• Link to the Auto Scaling
Group
• Define whether it’s an
addition or subtraction
for “adjustment”

$as-put-scaling-policy 
MyPolicyName-add1 
--auto-scaling-group
MyASGroupName 
--adjustment=1 
--type ChangeInCapacity 
--cooldown 300
$as-put-scaling-policy 
MyPolicyName-del1 
--auto-scaling-group
MyASGroupName 
--adjustment=-1 
--type ChangeInCapacity 
--cooldown 600
• Now you’re ready to configure your
CloudWatch Alarms to utilize the auto
scaling configuration!

• But wait…
CUSTOM CLOUDWATCH
METRIC
We need a custom metric!
Creating a CloudWatch Custom Metric
• Caveats:
– Custom Metrics can be stored as frequent as every 5
minutes
– After a while old data will be truncated

• Steps
– Install the AWS SDK for your favorite language
– Write simple script to calculate and store metric
– Schedule script by cron

• Code Sections:
– Set Up
– Metric Data Pulls
– Store New Metric
Custom Metric Code – Set Up
// Constants
define("CW_NAMESPACE", "Vocanic/VSocial");
define("CW_MONITORING_AWS_KEY_ID", "XXXXXXXXXXXXXXXXX");
define("CW_MONITORING_AWS_SECRET_ACCESS_KEY", "YYYYYYYYYYYYYY
YYY");
// Includes
include '/usr/lib/php5/amazon/sdk-1.5.17.1/sdk.class.php';

// Configure options for CloudWatch object
$options = array();
$options["key"] = CW_MONITORING_AWS_KEY_ID;
$options["secret"] = CW_MONITORING_AWS_SECRET_ACCESS_KEY;
// Set up Amazon Objects
$cw = new AmazonCloudWatch($options);
$cw->set_region(AmazonCloudWatch::REGION_SINGAPORE);
Custom Metric Code – Define Time
Bounds
// Define time bounds for pulling metric data
// We're only interested in the most recent metric
// These particular metrics are stored every 5 minutes)
$endTime = time(); // Store current unix time in end time
variable
$startTime = $endTime - 599; // Subtract 1 second less than
10 minutes
$endTime = date("j F Y H:i", $endTime);
$startTime = date("j F Y H:i", $startTime);
Custom Metric Code – Pull Metric Values
// Get Num Deleted Metric
$NumberOfMessagesDeletedMetric = $cw->get_metric_statistics(
'AWS/SQS', // CloudWatch Namespace of Metric
'NumberOfMessagesDeleted', // Name of Metric
$startTime, $endTime, // Timestamp bounds for pulling set
of metrics
60, // Attempt to get a number every 60 seconds, but in
reality, it's every 5 min
'Sum', // Statistics: Get Sum value
'Count', // Unit: Get a count of the values
array('Dimensions' => array(array('Name'
=>'QueueName', 'Value' => 'My_SQS_Queue_Name')))
// Define which SQS Queue you want this metric for
);
$NumberOfMessagesDeleted =
$NumberOfMessagesDeletedMetric->body>GetMetricStatisticsResult->Datapoints[0]->member->Sum;

*Repeat for Number Sent Metric
Custom Metric Code – Store New Metric
// Get Timestamp for storing in our custom metric so that
timing can match up
$TimeStamp = $NumberOfMessagesSentMetric->body>GetMetricStatisticsResult->Datapoints[0]->member->Timestamp;
// Get Difference of Sent versus Deleted
$SentVSDeleted = $NumberOfMessagesSent $NumberOfMessagesDeleted;
// Send metric to CloudWatch
$response = $cw->put_metric_data(CW_NAMESPACE, array(
array(
'MetricName' => 'DataPullQueueSentvsDel',
'Timestamp'
=> $TimeStamp,
'Value'
=> $SentVSDeleted
)));
AWS CloudWatch Custom Metric
Custom Metric in Practice
Scaling Deciding Factors

• For each scaling policy, you need to creating a specific
policy from the CLI
–
–
–
–

Queue Delta >100 for 5 min, Add 1 Instance
Queue Delta >350 for 5 min, Add 2 Instances
Queue Delta >1000 for 5 min, Add 4 Instance
Queue Delta < 10 for 60 minutes, Remove 1 Instance
Danger!
Queue Delta > 1000!!

When Alarms are
hit, Auto Scale
Out policy is
triggered, instan
ces are created
4 Instances Created

??
Thanks!
• Questions?

More Related Content

What's hot

All you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAll you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAmazon Web Services
 
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS Summit
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS SummitMonitoring Modern Applications: Best Practices - SRV338 - Chicago AWS Summit
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS SummitAmazon Web Services
 
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...Amazon Web Services
 
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...Amazon Web Services
 
Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)Julien SIMON
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape SoftwareTO THE NEW | Technology
 
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoDevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoAmazon Web Services
 
Auto scaling applications in 10 minutes (CakeFest 2013)
Auto scaling applications in 10 minutes (CakeFest 2013)Auto scaling applications in 10 minutes (CakeFest 2013)
Auto scaling applications in 10 minutes (CakeFest 2013)Juan Basso
 
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECS
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECSAnnouncing Blox - Open Source Projects for Customizing Scheduling on Amazon ECS
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECSAmazon Web Services
 
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...Amazon Web Services
 
Stream Processing in SmartNews #jawsdays
Stream Processing in SmartNews #jawsdaysStream Processing in SmartNews #jawsdays
Stream Processing in SmartNews #jawsdaysSmartNews, Inc.
 
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...Amazon Web Services
 
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanAmazon Web Services
 
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...Amazon Web Services
 

What's hot (20)

All you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAll you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up Loft
 
Auto Scaling on AWS
Auto Scaling on AWSAuto Scaling on AWS
Auto Scaling on AWS
 
AWS Cloud Watch
AWS Cloud WatchAWS Cloud Watch
AWS Cloud Watch
 
SRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoTSRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoT
 
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS Summit
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS SummitMonitoring Modern Applications: Best Practices - SRV338 - Chicago AWS Summit
Monitoring Modern Applications: Best Practices - SRV338 - Chicago AWS Summit
 
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
 
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...
Automating Management of Amazon EC2 Instances with Auto Scaling - March 2017 ...
 
Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
 
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoDevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
 
Auto scaling applications in 10 minutes (CakeFest 2013)
Auto scaling applications in 10 minutes (CakeFest 2013)Auto scaling applications in 10 minutes (CakeFest 2013)
Auto scaling applications in 10 minutes (CakeFest 2013)
 
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECS
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECSAnnouncing Blox - Open Source Projects for Customizing Scheduling on Amazon ECS
Announcing Blox - Open Source Projects for Customizing Scheduling on Amazon ECS
 
How Does Amazon EC2 Auto Scaling Work
How Does Amazon EC2 Auto Scaling WorkHow Does Amazon EC2 Auto Scaling Work
How Does Amazon EC2 Auto Scaling Work
 
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...
AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your ...
 
Aws Autoscaling
Aws AutoscalingAws Autoscaling
Aws Autoscaling
 
Stream Processing in SmartNews #jawsdays
Stream Processing in SmartNews #jawsdaysStream Processing in SmartNews #jawsdays
Stream Processing in SmartNews #jawsdays
 
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...
AWS July Webinar Series - Troubleshooting Operational and Security Issues in ...
 
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
 
SRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoTSRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoT
 
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...
AWS re:Invent 2016: Running Lean Architectures: How to Optimize for Cost Effi...
 

Viewers also liked

CloudWatch Logsについて
CloudWatch LogsについてCloudWatch Logsについて
CloudWatch LogsについてSugawara Genki
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsFelipe
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatchAmazon Web Services
 
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...Amazon Web Services
 
Cloudreach Voices AWS CloudWatch and Smart Monitoring
Cloudreach Voices AWS CloudWatch and Smart MonitoringCloudreach Voices AWS CloudWatch and Smart Monitoring
Cloudreach Voices AWS CloudWatch and Smart MonitoringCloudreach
 
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012Amazon Web Services
 
AWS サービスアップデートまとめ 2014年5月
AWS サービスアップデートまとめ 2014年5月AWS サービスアップデートまとめ 2014年5月
AWS サービスアップデートまとめ 2014年5月Yasuhiro Horiuchi
 
AWS サービスアップデートまとめ 2014年6月
AWS サービスアップデートまとめ 2014年6月AWS サービスアップデートまとめ 2014年6月
AWS サービスアップデートまとめ 2014年6月Yasuhiro Horiuchi
 
Manage Security & Compliance of Your AWS Account using CloudTrail
Manage Security & Compliance of Your AWS Account using CloudTrailManage Security & Compliance of Your AWS Account using CloudTrail
Manage Security & Compliance of Your AWS Account using CloudTrailCloudlytics
 
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...Matthias Stürmer
 
NACS Newsletter II CEBH
NACS Newsletter II CEBHNACS Newsletter II CEBH
NACS Newsletter II CEBHAminah Sheikh
 
Ips10 Optical inspection for small bores, by Jenoptik
Ips10  Optical inspection for small bores, by JenoptikIps10  Optical inspection for small bores, by Jenoptik
Ips10 Optical inspection for small bores, by JenoptikHommel Etamic (Jenoptik)
 
Wie Onlinevideo die Kommunikation verändert
Wie Onlinevideo die Kommunikation verändertWie Onlinevideo die Kommunikation verändert
Wie Onlinevideo die Kommunikation verändertAlexis Johann
 
Revista Internity Vodafone Septiembre 2012 (1)
Revista Internity Vodafone Septiembre 2012 (1)Revista Internity Vodafone Septiembre 2012 (1)
Revista Internity Vodafone Septiembre 2012 (1)Internity.es
 
Boletín Gente emi #44
Boletín Gente emi #44Boletín Gente emi #44
Boletín Gente emi #44grupoemi
 
Building Viral Social Experiences
Building Viral Social ExperiencesBuilding Viral Social Experiences
Building Viral Social ExperiencesJonathan LeBlanc
 
Rail Marketing doc PTC-Final
Rail Marketing doc PTC-FinalRail Marketing doc PTC-Final
Rail Marketing doc PTC-FinalJohn Gauthier
 
Elementos para diseñar una empresa de innovación de impacto
Elementos para diseñar una empresa de innovación de impactoElementos para diseñar una empresa de innovación de impacto
Elementos para diseñar una empresa de innovación de impactoPaula Cardenau
 
Klöckner & Co - Roadshow Presentation April 2011
Klöckner & Co - Roadshow Presentation April 2011Klöckner & Co - Roadshow Presentation April 2011
Klöckner & Co - Roadshow Presentation April 2011Klöckner & Co SE
 

Viewers also liked (20)

CloudWatch Logsについて
CloudWatch LogsについてCloudWatch Logsについて
CloudWatch Logsについて
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...
Revolutionising Cloud Operations with AWS Config, AWS CloudTrail and AWS Clou...
 
Cloudreach Voices AWS CloudWatch and Smart Monitoring
Cloudreach Voices AWS CloudWatch and Smart MonitoringCloudreach Voices AWS CloudWatch and Smart Monitoring
Cloudreach Voices AWS CloudWatch and Smart Monitoring
 
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012
SRG302 Archiving in the Cloud using Amazon Glacier - AWS re: Invent 2012
 
AWS サービスアップデートまとめ 2014年5月
AWS サービスアップデートまとめ 2014年5月AWS サービスアップデートまとめ 2014年5月
AWS サービスアップデートまとめ 2014年5月
 
AWS サービスアップデートまとめ 2014年6月
AWS サービスアップデートまとめ 2014年6月AWS サービスアップデートまとめ 2014年6月
AWS サービスアップデートまとめ 2014年6月
 
Manage Security & Compliance of Your AWS Account using CloudTrail
Manage Security & Compliance of Your AWS Account using CloudTrailManage Security & Compliance of Your AWS Account using CloudTrail
Manage Security & Compliance of Your AWS Account using CloudTrail
 
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...
Open Finance und Participatory Online Budgeting Apps: Politisches Crowdsourci...
 
NACS Newsletter II CEBH
NACS Newsletter II CEBHNACS Newsletter II CEBH
NACS Newsletter II CEBH
 
Ips10 Optical inspection for small bores, by Jenoptik
Ips10  Optical inspection for small bores, by JenoptikIps10  Optical inspection for small bores, by Jenoptik
Ips10 Optical inspection for small bores, by Jenoptik
 
Wie Onlinevideo die Kommunikation verändert
Wie Onlinevideo die Kommunikation verändertWie Onlinevideo die Kommunikation verändert
Wie Onlinevideo die Kommunikation verändert
 
Revista Internity Vodafone Septiembre 2012 (1)
Revista Internity Vodafone Septiembre 2012 (1)Revista Internity Vodafone Septiembre 2012 (1)
Revista Internity Vodafone Septiembre 2012 (1)
 
Boletín Gente emi #44
Boletín Gente emi #44Boletín Gente emi #44
Boletín Gente emi #44
 
Building Viral Social Experiences
Building Viral Social ExperiencesBuilding Viral Social Experiences
Building Viral Social Experiences
 
Rail Marketing doc PTC-Final
Rail Marketing doc PTC-FinalRail Marketing doc PTC-Final
Rail Marketing doc PTC-Final
 
Elementos para diseñar una empresa de innovación de impacto
Elementos para diseñar una empresa de innovación de impactoElementos para diseñar una empresa de innovación de impacto
Elementos para diseñar una empresa de innovación de impacto
 
PredimensionadoElectricidadRBT
PredimensionadoElectricidadRBTPredimensionadoElectricidadRBT
PredimensionadoElectricidadRBT
 
Klöckner & Co - Roadshow Presentation April 2011
Klöckner & Co - Roadshow Presentation April 2011Klöckner & Co - Roadshow Presentation April 2011
Klöckner & Co - Roadshow Presentation April 2011
 

Similar to Using AWS CloudWatch Custom Metrics and EC2 Auto Scaling -VSocial Infrastructure

오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
Accelerating your Business with Security
Accelerating your Business with SecurityAccelerating your Business with Security
Accelerating your Business with SecurityAmazon Web Services
 
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWSDay 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWSAmazon Web Services
 
Accelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAccelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAmazon Web Services
 
StackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStackStackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStackChiradeep Vittal
 
Harness the Power of Infrastructure as Code
Harness the Power of Infrastructure as CodeHarness the Power of Infrastructure as Code
Harness the Power of Infrastructure as CodeAmazon Web Services
 
Build a custom metrics on aws cloud
Build a custom metrics on aws cloudBuild a custom metrics on aws cloud
Build a custom metrics on aws cloudAhmad karawash
 
Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Amazon Web Services
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and DrupalPromet Source
 
VM Autoscaling With CloudStack VR As Network Provider
VM Autoscaling With CloudStack VR As Network ProviderVM Autoscaling With CloudStack VR As Network Provider
VM Autoscaling With CloudStack VR As Network ProviderShapeBlue
 
Tech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesTech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesIdeyatech
 
PowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael ColasPowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael ColasUK DevOps Collective
 
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)AWS Summit London 2014 | Improving Availability and Lowering Costs (300)
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)Amazon Web Services
 
Creating scalable solutions with aws
Creating scalable solutions with awsCreating scalable solutions with aws
Creating scalable solutions with awsondrejbalas
 
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia Amazon Web Services
 
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs Low
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs LowAWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs Low
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs LowAWS Germany
 
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2Peter Shi
 
Scott Paddock's AWS Chicago Healthcare slides - 2016
Scott Paddock's AWS Chicago Healthcare slides - 2016Scott Paddock's AWS Chicago Healthcare slides - 2016
Scott Paddock's AWS Chicago Healthcare slides - 2016AWS Chicago
 

Similar to Using AWS CloudWatch Custom Metrics and EC2 Auto Scaling -VSocial Infrastructure (20)

오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
 
Accelerating your Business with Security
Accelerating your Business with SecurityAccelerating your Business with Security
Accelerating your Business with Security
 
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWSDay 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWS
 
Accelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAccelerating YourBusiness with Security
Accelerating YourBusiness with Security
 
StackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStackStackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStack
 
IoT Heaps 6
IoT Heaps 6IoT Heaps 6
IoT Heaps 6
 
Harness the Power of Infrastructure as Code
Harness the Power of Infrastructure as CodeHarness the Power of Infrastructure as Code
Harness the Power of Infrastructure as Code
 
Build a custom metrics on aws cloud
Build a custom metrics on aws cloudBuild a custom metrics on aws cloud
Build a custom metrics on aws cloud
 
Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
VM Autoscaling With CloudStack VR As Network Provider
VM Autoscaling With CloudStack VR As Network ProviderVM Autoscaling With CloudStack VR As Network Provider
VM Autoscaling With CloudStack VR As Network Provider
 
Tech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesTech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web Services
 
PowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael ColasPowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael Colas
 
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)AWS Summit London 2014 | Improving Availability and Lowering Costs (300)
AWS Summit London 2014 | Improving Availability and Lowering Costs (300)
 
Creating scalable solutions with aws
Creating scalable solutions with awsCreating scalable solutions with aws
Creating scalable solutions with aws
 
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia
Black Belt Dojo - Daniel Hand - AWS Summit 2012 Australia
 
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs Low
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs LowAWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs Low
AWS STARTUP DAY 2018 I Keeping Your Infrastructure Costs Low
 
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2
AWS Melbourne Cost Mgt. and Opti. Meetup - 20181109 - v2.2
 
Scott Paddock's AWS Chicago Healthcare slides - 2016
Scott Paddock's AWS Chicago Healthcare slides - 2016Scott Paddock's AWS Chicago Healthcare slides - 2016
Scott Paddock's AWS Chicago Healthcare slides - 2016
 

Recently uploaded

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Recently uploaded (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Using AWS CloudWatch Custom Metrics and EC2 Auto Scaling -VSocial Infrastructure

  • 1. Auto Scaling Spot Instances with Custom CloudWatch Metrics AWS Singapore User Group Chris Drumgoole Head, Product Management
  • 2. Agenda • Quick overview of VSocial • Infrastructure Scaling Needs • Overview of EC2 Auto Scaling with AWS – Scaling from CloudWatch • Configuring Auto Scaling Launch Configs, Groups, and Policies • Creating your own CloudWatch Metric • Bringing it all together 2
  • 4. VSocial Overview • “Social Media Enterprise Command Center” • Core Features: – Social CRM – Social Media Community Management • Community Managers use tool to manage FB and TW communities • Tool helps manage conversations from multiple Social Media accounts
  • 5. A glance at the infrastructure… Database Cluster This needs to scale! Front-End Application Server Cluster Data Pull Data Pull AWS SQS Data Pull Data Pull AWS SNS Data Pull Data Pull Load Balancer Public Visitors
  • 6. Infrastructure Scaling Needs • Timely Conversation Data Pulls from Social Networks • Data Pull Processes can take longer due to: – Increased activity on channel (more tweets or FB Messages) – Network Latency • Slowdowns will cascade across all requests Requirement: Way to automatically adjust compute resources when needed based on real-time performance data, 24/7
  • 8. Introducing Auto Scaling (EC2) • AWS allows two types of Auto Scaling: – Minimal Configuration and Management directly from a CloudWatch Alarm – More advanced via SDK • AWS Supports auto scaling On-Demand or Spot Instances, depending on needs
  • 9. Spot Instances vs. On Demand Instances • Bidding System • Considerably cheaper than On Demand* – Micro Instances: • On Demand Pricing @ $0.02/hr  ~$14.40/mth • Spot Pricing @ >$0.004/hr  ~$2.88/mth – Small Instances: • On Demand Pricing @ $0.08/hr  ~$57.60/mth • Spot Pricing @ >$0.01/hr  ~$7.20/mth • Spot Instances not guaranteed • Great for non-mission critical tasks * All prices in USD for resources in the Asia Pacific Singapore Region
  • 10. Spot Instances and Our Needs • We need to be able to scale up data pull instances so we can keep up with volume (and mitigate slowdowns) • It’s ok if the machine are taken away from us, we’ll just request more. • Cost Savings is essential
  • 12. SETTING UP AUTO SCALING
  • 13. Configuring Auto Scaling Before you can finish setting up the CloudWatch Auto Scaling, you need to follow these steps: 1. 2. 3. 4. Install the AWS CLI tools on your trusty Linux box Create an Auto Scaling Launch Config Create an Auto Scaling Group Create Scale Out (Up) and In (Down) Policies
  • 14. Configuring Auto Scaling: Launch Configurations Defines the type of Instance to create • Create an AMI • Launch Config links to an AMI • Define Instance Type • Define max bid price (in USD, /hr) • Turn off Monitoring! $as-create-launch-config MyLaunchConfigName --image-id ami-123ab456 --instance-type t1.micro --spot-price 0.025 --key our_key_name --monitoring-disabled
  • 15. Configuring Auto Scaling: Scaling Groups • Create a Load Balancer to “hold” these launch configs • State what AZ zones you want these to be launched in • # Instances Lower and Upper bounds • Meta Configuration • Link to the Launch Configuration $as-create-auto-scaling-group MyASGroupName --availability-zones apsoutheast-1a,ap-southeast-1b --default-cooldown 120 --load-balancers VSocialCrons --min-size 1 --max-size 45 --tag="k=Name, v=SQSProcessor, p=true" --launch-configuration MyLaunchConfigName
  • 16. Configuring Auto Scaling: Policies • Need both Up and Down policies • Link to the Auto Scaling Group • Define whether it’s an addition or subtraction for “adjustment” $as-put-scaling-policy MyPolicyName-add1 --auto-scaling-group MyASGroupName --adjustment=1 --type ChangeInCapacity --cooldown 300 $as-put-scaling-policy MyPolicyName-del1 --auto-scaling-group MyASGroupName --adjustment=-1 --type ChangeInCapacity --cooldown 600
  • 17. • Now you’re ready to configure your CloudWatch Alarms to utilize the auto scaling configuration! • But wait…
  • 19. We need a custom metric!
  • 20. Creating a CloudWatch Custom Metric • Caveats: – Custom Metrics can be stored as frequent as every 5 minutes – After a while old data will be truncated • Steps – Install the AWS SDK for your favorite language – Write simple script to calculate and store metric – Schedule script by cron • Code Sections: – Set Up – Metric Data Pulls – Store New Metric
  • 21. Custom Metric Code – Set Up // Constants define("CW_NAMESPACE", "Vocanic/VSocial"); define("CW_MONITORING_AWS_KEY_ID", "XXXXXXXXXXXXXXXXX"); define("CW_MONITORING_AWS_SECRET_ACCESS_KEY", "YYYYYYYYYYYYYY YYY"); // Includes include '/usr/lib/php5/amazon/sdk-1.5.17.1/sdk.class.php'; // Configure options for CloudWatch object $options = array(); $options["key"] = CW_MONITORING_AWS_KEY_ID; $options["secret"] = CW_MONITORING_AWS_SECRET_ACCESS_KEY; // Set up Amazon Objects $cw = new AmazonCloudWatch($options); $cw->set_region(AmazonCloudWatch::REGION_SINGAPORE);
  • 22. Custom Metric Code – Define Time Bounds // Define time bounds for pulling metric data // We're only interested in the most recent metric // These particular metrics are stored every 5 minutes) $endTime = time(); // Store current unix time in end time variable $startTime = $endTime - 599; // Subtract 1 second less than 10 minutes $endTime = date("j F Y H:i", $endTime); $startTime = date("j F Y H:i", $startTime);
  • 23. Custom Metric Code – Pull Metric Values // Get Num Deleted Metric $NumberOfMessagesDeletedMetric = $cw->get_metric_statistics( 'AWS/SQS', // CloudWatch Namespace of Metric 'NumberOfMessagesDeleted', // Name of Metric $startTime, $endTime, // Timestamp bounds for pulling set of metrics 60, // Attempt to get a number every 60 seconds, but in reality, it's every 5 min 'Sum', // Statistics: Get Sum value 'Count', // Unit: Get a count of the values array('Dimensions' => array(array('Name' =>'QueueName', 'Value' => 'My_SQS_Queue_Name'))) // Define which SQS Queue you want this metric for ); $NumberOfMessagesDeleted = $NumberOfMessagesDeletedMetric->body>GetMetricStatisticsResult->Datapoints[0]->member->Sum; *Repeat for Number Sent Metric
  • 24. Custom Metric Code – Store New Metric // Get Timestamp for storing in our custom metric so that timing can match up $TimeStamp = $NumberOfMessagesSentMetric->body>GetMetricStatisticsResult->Datapoints[0]->member->Timestamp; // Get Difference of Sent versus Deleted $SentVSDeleted = $NumberOfMessagesSent $NumberOfMessagesDeleted; // Send metric to CloudWatch $response = $cw->put_metric_data(CW_NAMESPACE, array( array( 'MetricName' => 'DataPullQueueSentvsDel', 'Timestamp' => $TimeStamp, 'Value' => $SentVSDeleted )));
  • 26. Custom Metric in Practice
  • 27. Scaling Deciding Factors • For each scaling policy, you need to creating a specific policy from the CLI – – – – Queue Delta >100 for 5 min, Add 1 Instance Queue Delta >350 for 5 min, Add 2 Instances Queue Delta >1000 for 5 min, Add 4 Instance Queue Delta < 10 for 60 minutes, Remove 1 Instance
  • 28. Danger! Queue Delta > 1000!! When Alarms are hit, Auto Scale Out policy is triggered, instan ces are created 4 Instances Created ??