Amazon Web Services – Flexibility in EC2 Spot Instances
In this article, we are going to look into the key points to keep in mind while using an Amazon EC2 Spot Instances effectively with instance flexibility. Here we will try to answer the three key questions:
- Why is Instance Flexibility needed?
- How to manage Spot instance using EC2 Fleet for your environment?
Why is Instance Flexibility needed?
Spot instances are unused EC2 capacity which means the amount of it available in any one specific instance type and size varies over time. So by using more than one instance option you increase the pool of capacity you have access to, achieving greater scale and reducing the impact of any one capacity pool getting interrupted.
As spot instances are often 70 to 90 percent cheaper than on-demand instances. You’ll often be able to find more powerful instances and still save a fortune.
For example, if you needed two vCPUs and four gigs of memory you might choose the c4.large. On the spot that’s a 71 percent discount versus c4.large on-demand.
However, even the m4.large is a 70 percent discount on the spot versus running the c4.large on-demand despite the fact that has two vCPUs and eight gigs of memory.
So hopefully by now, you understand why instance flexibility is so important and agree it is possible to use more than one instance type while saving a fortune.
Management of Spot Instances:
You might wonder how to automate the management of different instance types in a single application. For this, you can check out the EC2 Fleet. Here you define the instances that work for you and let the EC2 fleet do the rest.
Benefits & Features of Using EC2 Fleet:
Following are the benefits of using EC2 Fleet:
- Reduce Costs: It combines spot, on-demand, and RIs to run workload at the lowest possible cost.
- Operational Efficiency: It provisions compute capacity across purchase options, instances types, and AZs with a single API.
- 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 instances with a single API call & scale to 1000s of cores, TBs of memory, etc.
- Simplified Provisioning: Select instances, assign weights, specify target capacity for On-Demand and Spot Instances, and build a fleet within seconds.