Part 1: Understanding Spot Instances and Migration

Written by Krishnan S G


Spot instances are a great set of offering from AWS with prices up to 90% lower than On-Demand instances.

Some questions that naturally pop up in our mind are:

  • Why is AWS providing discounts up to 90% on using Spot?

  • Is Spot suitable for my workload?

  • How can I migrate to Spot?

This blog post helps answer these questions and educates the users on Spot and how Cloudwiry can catalyze the migration.

 

Overview of Spot

Spot is the 3rd pricing policy and the cheapest of AWS offers apart from OnDemand & RIs. Spot instances are a set of unused EC2 instances lying unused in AWS data centers, hence AWS provides heavy discounts of up to 90% to minimize the number of unused instances.

 

Why use EC2 Spot Instances?

1. Low, predictable prices

You can purchase Spot Instances at prices up to 90% lower than On-Demand instances. Moreover, you can provision capacity across Spot, On-Demand, RIs, and Savings Plans Instances using EC2 Auto Scaling to optimize workload cost with performance.

2. Massive scale

Spot offers you the advantages of the massive operating scale of AWS. You can run hyper-scale workloads at significant cost savings or you can accelerate your workloads by running parallel tasks.

3. Easy to use

It’s easy to launch, scale and manage Spot Instances through AWS services, like EC2 Auto Scaling and ECS, or integrated third parties, like Terraform and Jenkins.

 

Is Spot suitable for my workload?

Spot instances are well suited to a variety of workloads. Spot can be used for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads.

Source: AWS

 

Understanding Spot Instances’ limitations

Spot instances can be terminated by AWS for any of the following reasons.

  • Price – The Spot price is greater than your maximum price.

  • Capacity – If there are not enough unused EC2 instances to meet the demand for Spot Instances, AWS interrupts Spot Instances. The order in which the instances are interrupted is determined by Amazon EC2.

  • Constraints – If your request includes a constraint such as a launch group or an Availability Zone group, these Spot Instances are terminated as a group when the constraint can no longer be met.

In the event of interruption for any of the reasons mentioned above, AWS provides a 2 mins interruption notice before terminating the instance.

 

Tackling Spot interruptions

  1. Hibernate – Launch spot instance with hibernate option enabled, so when the instance is interrupted the state is preserved in the EBS volume and will be billed for the EBS volume.

  2. Spot Blocks – Spot Instances can be spawned for a specified duration these are designed not to be interrupted and will run continuously for the duration you select.

    eg: Comparison of m5.large Linux pricing for US East (N. Virginia)

OnDemand

Spot Block for 1 hour

Spot Block for 6 hours

$0.096 per Hour

$0.053 per Hour

$0.067 per Hour

After a Spot Instance is hibernated by the Spot service, it can only be resumed by the Spot service. The Spot service resumes the instance when capacity becomes available.

This brings us to the end of the first part of our series on Spot Instances and Migration. In the second part, we will cover some important factors we need to understand in order to identify instances that would give the highest ROI on migration to Spot.

 

For more strategies on how to optimize your cloud, schedule a call with our cloud experts or drop us an email at hello@cloudwiry.com.

GET STARTED
cloudwiryqa
Share
This