At AWS re:Invent 2017, one of the announcements that was made is that spot instance hibernation is now available. This change to how AWS spot instances works can mean some tweaks to how you approach this instance type. Let’s explore the ramifications of this and see what it means for you and your infrastructure.
What are Spot Instances?
When you use a cloud provider like AWS, they run data centers so you don’t have to. In doing so, those data centers have similar side effects as traditional on-prem deployments, including spare compute power when utilization is low. AWS decided to let free market forces work to their advantage by offering these spare resources at auction-style prices.
How this worked in practice (prior to this recent hibernation announcement) involved naming your bid price for how much you were willing to pay for an EC2 instance. Once the price of a spot instance went below your bid price, your instance started up and began doing work. Later, when the cost was above your bid price, your instance would be terminated.
Typical Spot Instance Use Cases
As you can tell, spot instances introduce a different way of thinking about your resources. There are some use cases that don’t make any sense for spot instances, but others that can work well. For instance, high-performance computing scenarios that need a lot of machines for a short period of time can work well with spot instances, as long as the result isn’t extremely urgent. Another possibility is batch processing, like video conversions or scientific analysis, which can typically be done in off-hours without a human present to manually tweak things.
Hibernation vs. Termination
As mentioned above, the loss of a spot instance used to result in termination of the instance, regardless of the data or state of the machine. With Amazon’s recent announcement, you can now have spot instances hibernate instead. This means the system’s memory will be saved to the root EBS volume, then reloaded when the machine is resumed. It’s like time travel, but for your cloud infrastructure!
From a practical perspective, this can change how you approach spot instances. The main benefit is that you don’t have to prepare for sudden termination of your virtual machine, so more workloads could use spot instances with less preparation. The downside to this is that while your workload will eventually finish, you can’t quite be sure of when.
Spot Instances vs. Parking Schedules
The “not being sure when” part is the big differentiator between spot instance hibernation versus on-demand EC2 instances with parking schedules applied via ParkMyCloud. This new hibernation features means lots of benefits and cost savings, but introduces a nebulous time frame that tends to make developers (and executives) nervous. By utilizing known parking schedules that are automatically applied to instances, the cost savings can be quite comparable while maintaining business-hour uptime. The additional flexibility of manual or automated overrides via ParkMyCloud’s UI or API can mean all the difference to your cloud infrastructure team and the application owners who are running these workloads.
AWS claims that you can save up to 90% on your instance costs with spot instances. In the real world, various reports seem to be in the 50%-70% range, based on some stats from large companies like Pinterest and Vimeo. With parking schedules, most development teams turn off systems on nights and weekends, which is around 65% of the time. This means you can get similar savings, but with different timing structures for your use. The best way to save the most is to use a combination, so check out Amazon’s spot instances and try out ParkMyCloud for cost optimization for all workload types!