based set of instances running TaskTrackers and DataNodes Scaling up or down is as easy as updating the Desired value (assuming you don’t have any AS metrics) You can also do Auto scaling based on specific metrics from CloudWatch
AWS If you’re running 100 c3.2xlarge instances, you’re spending 100 * 0.420 = $42 per hour and $1008 (100 * 0.420 * 24) per day Problem 1 - Cost of On Demand Instances
instances No guarantees on how long they’re available Spot Prices are highly volatile But, highly cost effective if used right Spot’s “Demand vs Supply” is local to it’s Spot Market AWS Spot Primer
the following dimensions • Instance Types, Regions and Availability Zones The number of spot markets is product of all the above numbers. Example - Requirement for 36 CPUs per instance • Instance Types - [d2.8xlarge, c4.8xlarge] • AZs - [us-east-1a, us-east-1b, us-east-1c, …] • Region - [us-east, us-west, …] - 9 regions • Total in US-EAST (alone) => 2 * 1 * 5 = 10 spot markets AWS Spot Markets
value in terms of cost of the same compute, there’s no guarantee on when the machines are going to be taken away There’s always Spot Termination Notice, but unfortunately not all applications are AWS-aware like Hadoop in our case Problem 2 - Spot Outages
We saw our AWS bill was gradually increasing on “Data Transfer” section Because HDFS write pipeline is not very AWS-Cross-AZ-Data-Transfer-Cost aware With HDFS on Spot, each machine going down meant replication will kick in from start Problem 3 - Cost of Data Transfer
across AZs to protect against Spot price fluctuations Results in HUGE data transfer costs ASG always try to evenly distribute the machines and doesn’t take cost into account Matsya - Motivation
running Scala app that monitors spot prices and moves the ASG to cheapest AZ Meant to be run as a CRON task Can fallback to OD (if required) Posts notifications to Slack when migrating Matsya
Blocks More notification systems Multiple Region support Multiple Product support Minimum number of OD instances Work In Progress Questions? github.com/ind9/matsya