Amazon are celebrating 10 years of AWS. On Amazon’s celebration page, they include an interesting insight regarding EC2 Spot Instances:
Although many customers are utilizing spot instances, AWS have made it so easy to launch on-demand instances that customers typically have the majority of their compute on the more costly on-demand pricing model.
Spot instances require the customer to identify the types of workload that can be handled by spot instances and understand the bidding process.
Spot instances can suit workloads that are time flexible and not sensitive to interruption e.g. Media encoding, scientific computing or financial modeling. Spot instances integrate with other services such as Auto Scaling, VPC, CloudFormation and EMR so they can be incorporated into existing architectures.
To make a spot instance request, a bid price must be submitted. Spot Bid Advisor gives customers an idea how likely a bid price of 25%, 50% and 100% of the on-demand instance price is likely to be outbid. Example for 25% of the on-demand price for m3.medium instances in the Asian Pacific (Sydney) region right now:
Instance Type | m3.medium |
vCPU | 1 |
Memory (GiB) | 3.75 |
Savings over On-Demand | 84% |
Frequency of being outbid (month) | Low |
Frequency of being outbid (week) | Low |
From this, it looks likely that we can get some m3.medium spot instances for 25% of the on-demand price. The on-demand price is currently $0.093 per hour in Sydney) so $0.02 could be a high enough bid price.
To illustrate this, GorillaStack have open sourced this CloudFormation template to create a spot request for a 2 instance “fleet” of m3.medium instances for $0.02 per hour each: You can grab it from GorillaStack GitHub now.
Spot Fleets are a convenient way to manage EC2 spot instances. A fleet can be anything from one EC2 instance to thousands that are all working together as part of a distributed application. The instances may come and go from time to time as Spot prices change or if the fleet’s capacity is updated, but the fleet itself retains its identity and its properties.
At GorillaStack, we are relentless at finding Cloud Cost Optimization, and spot instances & fleets can help to reduce cost. “You can save up to 90% [using spot instances] compared to on-demand prices.” – AWS EC2 console (beta version).
Spot Bid Advisor is a good resource but we need to programmatically determine prices to automate anything. AWS provide spot price history for the past 90 days through their CLI and SDKs. Check out this example that uses the JavaScript SDK to get spot price history for m3.medium Linux/UNIX instances in all Sydney availability zones:
0.014500 was the price which you have to bid to guarantee that a single Spot request is fulfilled which later rose to 0.014700. If your bid price is below 0.014700 then AWS will terminate your spot instance(s) that are in service. Your bid price will be a trade off against uptime and speed of request fulfillment. Just like the financial markets: Keep in mind that the historical trends are not a guarantee of future results.
We believe that there’s a significant opportunity for AWS technology partners such as GorillaStack to help companies with their forays into the spot instance market space.
In the meantime, what would help your company utilize spot instances? If you’re looking for alternatives, you can consider other AWS pricing plans such as AWS Savings plan or Reserved Instances. We’re constantly looking for ways to help our customers save money in the Cloud. Book a demo with us and let us help you to optimize your cloud bills today.
Happy bidding.