all things spot
TRANSCRIPT
Rahul PrasadProduct Manager
Jithendra BalakrishnanHead of Technology
All Things Spot! AWS Cost Optimization using
Spot Instances and More
Why do you need AWS Cost optimization? What is a Spot Instance and why you need to consider
it? What is a Spot Block & Spot Fleet? What use cases are good candidates? Who are we?
Agenda – All Things Spot!
Managing cloud complexity & optimizing cloud costs are top challenges today
State of Cloud Report 2016
Spare Capacity at Steep Discounts (Sometimes
90% lower)
Auction based pricing model
Demand –Supply Economics
What Is a Spot Instance?
AWS EC2 Instance Pricing Options
On Demand Instances: Hourly rate
Reserved Instances: Upfront paymentLower hourly fee Capacity reservation
Spot Instances: Bid for unused EC2 capacity
AWS EC2 Instances (SI) Bid for unused EC2 capacity
The hourly price for a SI (of each instance type in each Availability Zone) is set by Amazon EC2
Hourly price fluctuates depending on the supply and demand of SI
SI runs whenever your bid exceeds the current market price.
SI might not start immediately
AWS might terminate SI as hourly price or availability changes. Partial hours are not charged.
AWS EC2 Instance Life Cycle
Bid Price
Instance Count
Launch Specification: AMI Id, Availability zone, Keypair, Security Group VPC, SubnetID
Type: One Time / Persistent ValidFrom , ValidUntil
Create Request
Request
Launch Instances
Interrupt (Spot Termination)
One-TimeRequest Failed
Interrupt (Persistent)
Spot Instance requests can be created with AWS SDK’s, from management console and AWS clients.
AWS EC2 Instance Request States
open—The request is waiting to be fulfilled.
active—The request is fulfilled and has an associated Spot Instance.
failed—The request has one or more bad parameters.
closed—The Spot Instance was interrupted or terminated.
canceled—You canceled the request, or the request expired.
EC2 Spot Instance Termination Notices
If current spot price > bid price, the Spot instance is reclaimed by AWS.
2 minutes before the spot instance is reclaimed the instance state is set to marked-for-termination.
Applications / scripts can poll the instance metadata to check for this notice and save its state, upload final log files, or remove itself from an Elastic Load Balancer.
EC2 Spot Block
Guaranteed Availability for a given duration (1 to 6 hours)
Good for defined duration workloads Savings typically 30-45% less than on-demand Off peak 5% extra savings Priced separately compared to AWS Spot
Instances
EC2 Spot Fleet Request
Fleet of Spot instances of different instance types Allocation strategy required (lowestprice/diversified) Allocate instance pool using instance weighting
Spot fleet request includes:
Target Capacity One or more launch specification for the instances
Launch specification includes – AMI Id, instance type, subnet, AZ, security group and keypair name.
Maximum price per instance hour (bid price)
Strategies with Spot
Choose a reasonable bid price
Ensure the AMI contains all required software, so that you can start quickly
Sync important data to a persistent location (EBS / S3)
Divide the work into smaller chunks or have checkpoints to save work frequently
EC2 Spot Instance Termination Notices
Poll instance meta-data every 5 seconds with the following command
If your Spot Instance is marked for termination by the Spot service, the termination-time item is present (2015-05-02T 01:00:00Z)
the termination-time item is either not present (so you receive an HTTP 404 error) or contains a value that is not a time value.
if curl -s http://169.254.169.254/latest/meta-data/spot/termination-time | grep -q .*T.*Z; then echo ‘notified for termination”; fi
Financial Analysis
ScientificAnalysis
Batch Workloads
Web Crawling
Audio/ Video Encoding
Testing
Document Transformation
Map Reduce
Hedge fund Analytics, Energy Trading, Monte Carlo
Simulations
Scale Out Processing
Extract & Process Internet
Data
Encode, Render & Process Large
Audio & Video Files
Load & Simulation Testing For Websites &
Apps
PDF Generation, OCR Processing
Etc.
Big Data Workloads
Simulations, Drug Discovery,
Testing
Spotvantage
• Team working together for 8 years with deep expertise in public cloud
• One of the earliest adopters of AWS globally• Part of The Alchemist Accelerator (top tier
accelerator backed by leading valley VC’s) in San Francisco
• Backed by Mumbai Angels and Knight & Bishop L.P• Defining an SLA driven computing model for the
enterprise market
About 47Line
Batchly is an enterprise solution that fully automates AWS provisioning (including Spot & Reserved Instances) resulting in significant
cost (up to 90%) savings.
batch.ly: What it does
Abstracts cloud complexity Automatically optimizes infrastructure using
On-Demand, Reserved and AWS Spot Instances for significant savings
Provides Cost Optimization Provides Visualization for spend management Machine Learning for intelligent
recommendations
Continuous Learning Algorithm *
Standard Rank
Price Rank
Run Instances
Metrics
• Throughput• Utilization
System Parameters
• Spot Price• Availability
Market Parameters
* Patent Pending
Batchly Customer Impact
16K TRANSCODE
Files
Savings
80%On-Demand Cost – 25KCost using Batchly – 5K
AWS ETS / Zencoder – 75K
“While comparing the costs with cloud transcoders, Batchly was 10X cheaper and 80% lower than AWS on-demand”Brandon Woodward, Head of Product
Contact
Jithendra [email protected]
47Line Inc.
Rahul [email protected]
47Line Inc.
We are hiring!Send your resume to [email protected]