Spot Instance Interruptions
EC2 Spot Instances can be launched on spare EC2 capacity in exchange for returning them when Amazon EC2 needs the capacity back. The event of reclaiming the Spot instance is known as Spot Instance interruption. The interruptions occur when AWS requires an extra capability to service customers who purchased reserved instances.
When Amazon EC2 interrupts a Spot Instance, it terminates, stops, or hibernates the instance. AWS can terminate spot instances with just a 2-minute warning. Demand for Spot Instances and the availability of Spot instances vary from time to time. On-Demand Instances specified in an EC2 Fleet or Spot Fleet cannot be interrupted.
There are three possible reasons that may cause EC2 to interrupt the Spot instance.
-
When the Spot price is greater than the client’s maximum price.
-
When EC2 reclaims the instance mainly to repurpose capacity or for host maintenance and hardware decommission.
- If a Spot request includes a constraint, they are terminated when the constraint can no longer be met.
Pricing History
Spot Instance prices are set by Amazon EC2 and are adjusted gradually based on the long-term trends in supply and demand for Spot Instances. While requesting EC2 Spot Instances, it is recommended to use the default maximum price so that, when the request is fulfilled, the Spot Instances launch at the current Spot price and not more than the On-Demand price. To view the Spot Instance pricing history, navigate to the Amazon EC2 console, choose Spot Requests and click on Pricing history.
Read more, Amazon Hirepro
Getting started
To create Spot Instances, the very first step is to get set up to use Amazon EC2. If you don’t have an account, sign up for a free tier here.
-
Create a key pair and a security group at the Amazon EC2 console. Refer to the documentation to do this.
-
Launch, set up and connect to an EC2 Linux instance. Refer here.
-
Create a Spot Instance request. Refer here.
Spot instances can be launched in a launch group, an availability group or in a VPC (Virtual Private Cloud).
Strategies to use Spot Instances
On-Demand instances can be launched immediately if a manual launch request is made and capacity is available. Spot instances are launched if the Spot Instance request is active and capacity is available. A minimum level of guaranteed compute resources can be maintained by launching a core group of On-Demand Instances, and supplementing them with Spot Instances when the opportunity arises.

Source
AWS Spot Fleet
An AWS Spot Fleet is a set of EC2 Spot Instances and optional On-Demand Instances launched based on criteria specified by the cloud user. The Spot Fleet selects Spot capacity pools that match the client’s needs and launches Spot Instances to meet the target capacity for the fleet. By default, Spot Fleets maintain target capacity by launching replacement instances after the Spot Instances in the fleet are terminated. Spot Fleet attempts to replace terminated instances using the lowest priced option available. If a Spot Fleet is submitted as a one-time request, it does not persist after the instances have been terminated. On-Demand Instance requests can also be included in a Spot Fleet request.
FAQs
How is a Spot Instance different from an On-Demand instance?
Spot Instances and On-Demand or Reserved instances function the same way. The main differences are that Spot Instances offer a significant discount on the On-Demand prices, instances can be interrupted by Amazon EC2 for capacity requirements with a 2-minute notification, and Spot prices are adjusted gradually based on long term supply and demand for spare EC2 capacity.
What is the benefit if a Spot instance hibernates on interruption?
During hibernation, EC2 Spot instances will pause and resume around any interruptions so that workloads can pick up from exactly where they left off. The instances retain their state across shutdown-startup cycles.
Conclusion
This article extensively discusses EC2 Spot Instances in AWS. We hope that this blog has helped you enhance your knowledge of the need for AWS Spot Instances and its advantages. If you want to learn more, check out our articles on AWS License Manager, Cloud Computing Infrastructure and Cloud Architecture. Learn more about Big Data, Microsoft Azure, AWS and Google Cloud. Refer to Important AWS Interview Questions to ace your Amazon Interviews.
Explore our Coding Ninjas Library and upvote our blog to help other ninjas grow. Happy Coding!