A Spot Instance is an instance that uses spare EC2 capacity that is available for less than theOn-Demand price. Because Spot Instances enable you to request unused EC2 instances at steepdiscounts, you can lower your Amazon EC2 costs significantly. The hourly price for a Spot Instance iscalled a Spot price. The Spot price of each instance type in each Availability Zone is setby Amazon EC2, and is adjusted gradually based on the long-term supply of and demand for Spot Instances.Your Spot Instance runs whenever capacity is available.
Spot Instances are a cost-effective choice if you can be flexible about when your applications runand if your applications can be interrupted. For example, Spot Instances are well-suited for dataanalysis, batch jobs, background processing, and optional tasks. For more information, seeAmazon EC2 Spot Instances.
For a comparison of the different purchasing options for EC2 instances, seeAmazon EC2 billing and purchasing options.
Before you get started with Spot Instances, you should be familiar with the followingconcepts:
Spot capacity pool – A set of unused EC2 instances with thesame instance type (for example,m5.large
) and AvailabilityZone.
Spot price – The current price of a Spot Instance per hour.
Spot Instance request – Requests a Spot Instance. When capacity is available,Amazon EC2 fulfills your request. A Spot Instance request is eitherone-time orpersistent. Amazon EC2automatically resubmits a persistent Spot Instance request after the Spot Instance associated withthe request is interrupted.
EC2 instance rebalance recommendation – Amazon EC2emits an instance rebalance recommendation signal to notify you that a Spot Instance isat an elevated risk of interruption. This signal provides an opportunity toproactively rebalance your workloads across existing or new Spot Instances without havingto wait for the two-minute Spot Instance interruption notice.
Spot Instance interruption – Amazon EC2 terminates, stops, or hibernates yourSpot Instance when Amazon EC2 needs the capacity back. Amazon EC2 provides a Spot Instance interruptionnotice, which gives the instance a two-minute warning before it isinterrupted.
The following table lists the key differences between Spot Instances andOn-Demand Instances.
Spot Instances | On-Demand Instances | |
---|---|---|
Launch time | Can only be launched immediately if the Spot Instance request is activeand capacity is available. | Can only be launched immediately if you make a manual launchrequest and capacity is available. |
Available capacity | If capacity is not available, the Spot Instance request continues toautomatically make the launch request until capacity becomesavailable. | If capacity is not available when you make a launch request,you get an insufficient capacity error (ICE). |
Hourly price | The hourly price for Spot Instances varies based on long-term supplyand demand. | The hourly price for On-Demand Instances is static. |
Rebalance recommendation | The signal that Amazon EC2 emits for a running Spot Instance when the instanceis at an elevated risk of interruption. | You determine when an On-Demand Instance is interrupted (stopped, hibernated,or terminated). |
Instance interruption | You can stop and start an Amazon EBS-backed Spot Instance. In addition,Amazon EC2 caninterrupt anindividual Spot Instance if capacity is no longer available. | You determine when an On-Demand Instance is interrupted (stopped,hibernated, or terminated). |
You pay the Spot price for Spot Instances, which is set by Amazon EC2 and adjusted gradually based on thelong-term supply of and demand for Spot Instances. Your Spot Instances run until you terminate them,capacity is no longer available, or your Amazon EC2 Auto Scaling group terminates them duringscale in.
If you or Amazon EC2 interrupts a running Spot Instance, you are charged for the seconds used or thefull hour, or you receive no charge, depending on the operating system used and whointerrupted the Spot Instance. For more information, seeBilling for interrupted Spot Instances.
Spot Instances are not covered by Savings Plans. If you have a Savings Plan, it does not provide additional savings on top of the savings that you already get from using Spot Instances. Furthermore, your spend on Spot Instances does not apply the commitments in your Compute Savings Plans.
To view the current (updated every five minutes) lowest Spot price per AWS Region andinstance type, see theAmazon EC2 Spot InstancesPricing page.
To view the Spot price history for the past three months, use the Amazon EC2 console orthedescribe-spot-price-history command. For more information, seeView Spot Instance pricing history.
We independently map Availability Zones to codes for each AWS account. Therefore, you canget different results for the same Availability Zone code (for example,us-west-2a
) between different accounts.
You can view the savings made from using Spot Instances for a singleSpot Fleet or for all Spot Instances.You can view the savings made in the last hour or the last three days, and you canview the average cost per vCPU hour and per memory (GiB) hour. Savings are estimatedand may differ from actual savings because they do not include the billingadjustments for your usage. For more information about viewing savings information,seeSavings from purchasing Spot Instances.
Your bill provides details about your service usage. For more information, seeViewing your bill in theAWS Billing User Guide.