Más contenido relacionado La actualidad más candente (20) Similar a Amazon EC2 Spot Instances (20) Más de AWS User Group Bengaluru (20) Amazon EC2 Spot Instances1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Chakra Nagarajan
Specialist Solutions Architect – EC2 Spot
Nov 2018
Amazon EC2 Spot Instances
Overview and best practices
2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
• EC2 Spot Instances overview
• New pricing model – eliminate the bid
• New features and functionality
• Where to use Spot
• Interruption details
• Spot orchestration options (Fleet, ASG)
• Monitoring price and usage
3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We help
save koalas!
4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
On-Demand
Pay for compute capacity by
the second or hour with no
long-term commitments
For spiky workloads or to
define needs initially
AWS EC2 Consumption Models
Reserved
Significant discount compared to
On-Demand instance pricing
Steady state applications or
predictable usage, databases
Spot
Spare EC2 capacity for up to 90%
off the On-Demand price.
For fault tolerant, instance flexible
or time-insensitive workloads
5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Spot Instances
Spare EC2 Capacity that AWS can reclaim with a 2 minute notice
Low Cost Easy access Usage flexibility
6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spare capacity at scale
Clemson university – 1.1 Million cores
https://tinyurl.com/clemson-spot
7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Very Simple Rules of Spot Instances
The price changes infrequently
based on supply and demand of
spare capacity
Just request capacity and pay the
current rate. When we need the
capacity back you’ll get a 2 minute
warning
8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Time flexibility
examples
• Model training
• Genomics
• Development
• Testing
• One-time queries
Time sensitive workloadsTime insensitive workloads
examples
• Web services
• APIs
• Analytics
• Grid computing
• Containers
9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How customers are using Spot instances
Big Data Containers & CI/CD HPC & Batch
Stateless Web
Services
• Benefits: Provides
acceleration, scale, and
deep cost savings to hyper-
scale workloads
• Features: Scale to large
numbers of parallel nodes
via Spot Fleet
• Integrations: EMR, Hadoop
or Spark; Specify 5 instance
types with weighted
capacities via EMR Instance
Fleets
• Benefits: Deploy stateless
containerized workloads and
manage clusters at any
scale at a fraction of the cost
• Features: Create EC2 Spot
Fleet directly from the ECS
console; Hibernate CI/CD
instances
• Integrations: ECS, EKS,
K8, KOPS, Kube-AWS,
Jenkins, Bamboo
• Benefits: Run multiple
projects simultaneously;
launch & de-commission
1000s of nodes
• Features: Spot Auto Scaling
groups; F1(FPGA), eg1
(Elastic GPUs), Cluster GPU
instances to accelerate
processing
• Integrations AWS Batch,
CloudFormation, Spot Fleet,
ECS
• Benefits: Scale, throughput
and deep cost savings for
large-scale web operations
• Features: launch and
manage a collection of
diversified Spot Instances
across pools Spot Fleet
• Integrations: Spot Fleet,
CloudFormation, EC2 Auto
Scaling
10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS
CloudFormation
AWS
OpsWorks
Amazon
EMR
Amazon
ECS
AWS Data
Pipeline
AWS BatchAuto Scaling
Amazon EC2 Spot works with…
11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
1b 1c1a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On
Demand
$0.88
$0.44
$0.22
$0.11
EC2 Spot pools
Each instance family
Each instance size
Each Availability Zone (55)
In every region (18)
Is a separate Spot pool
R5
M4
C5
I3 M5d
R4 D2
C4
12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Low, Predictable Prices Eliminate the bid!
New Pricing Model
13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
New Pricing Model - summary
• Reliable Spot costs – prices change less frequently
• No “bidding” required – if you choose to bid you’re setting a “Maximum price”
• Price no longer changes to reclaim instances
14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Handling interruptions
Spot is optimized for stateless,
fault-tolerant, or flexible workloads.
Any application that can can have part
or all of the work, paused and resumed
or restarted, can use Spot.
Minimal interruptions
Over 95% of the instances were not
interrupted in the last 3 months
Check for 2-minute instance termination notice via instance
metadata or CloudWatch metrics and automate by:
☑ Checkpointing
☑ Draining from ELB
☑ Using stop-start and hibernate to restart faster
The work you are doing to make
your applications fault-tolerant
also benefits Spot
15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot Instance Advisor - Example
16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Interruption notices via CloudWatch Events
https://tinyurl.com/spot-cwe
Or poll the instance metadata internally
17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot on RunInstances
$ aws ec2 run-instances --image-id ami-15e9c770
--count 1 --instance-type c4.large --instance-market-options MarketType=spot
no bid/max price
No need to use a different API
18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot fleet
• One-time request, or Maintains a collection of EC2 Instances
• Allocation strategy: Lowest Price or Diversified (across N number of pools)
• Integrated with ELB
• Auto scaling with target tracking or scheduled scaling
• On-demand capacity
• Multiple instance specifications
• Instance weights – scale according to your application needs (# of vCPU)
• Fleet Cloudwatch metrics (target capacity, fulfilled capacity)
19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Fleet
Benefits
Reduce costs
Combine Spot, On-Demand and RIs to
run workloads at the lowest possible cost
Increase operational efficiency
Provision compute capacity across purchase
options, instance types, and AZs with a single API
Key features
Flexible capacity
allocation
Select an instance allocation
strategy that works for your
app and scale in App-aware
units (vCPU, GB RAM, etc.)
Massive
scale
Launch 1000’s of instances
with a single API call and
scale to 1000’s of cores,
TB’s of memory, etc.
Simplified
provisioning
Select instances, assign
weights, specify target
capacity for On-Demand
and Spot Instances, and
build a fleet within seconds
Spot
Instances
On-Demand
Instances
On-Demand
Instances
Spot
Instances
Reserved
Instances
Reserved
Instances
AZ1 AZ2
20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot Blocks
• Defined duration workload without interruptions
• 1-6 hours
• Lower discounts compared to Spot
21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Interruption behaviors
Terminat
e
HibernateStop
22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Is my workload Spot Ready?
Stateless Fault-Tolerant Flexible: Multi-
AZ and Instance
Flexibility
Loosely Coupled
Looks familiar?
23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot price history
24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monitoring Spot usage – Cost Explorer
Y e a r b y m o n t h – l o n g t e r m t r e n d s
25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monitoring Spot usage – Cost Explorer
M o n t h b y d a y – s h o r t t e r m c h a n g e s a n d a n o m a l y d e t e c t i o n
26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customers across different
industries and vertical use Spot..
27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you