Introduction to AWS Spot Instances

Amazon Web Services offers a variety of purchase options that allow customers to optimize their cost investments based on actual usage requirements changing in real-time or dynamically. Customers can purchase capacity, host infrastructure and instances on demand for short term use, schedule subscriptions for recurring demands or reserve instances for the long term. The cost for each option can vary based on capacity and usage statistics, schedule, AWS services and solutions employed.

AWS essentially offers a purchase structure for every type of organization and usage requirements. The company is continuously expanding its infrastructure and pursues a wider market to maximize profitability. This means that a range of AWS infrastructure resources are left unused at any given moment. Failing to sell the available resource capacity translates into lost business opportunity and potentially losses for the cloud vendor. In order to attract more customers, AWS therefore offers the purchase structure of Spot Instances, which allows customers to take advantage of the unused AWS capacity at a heavily discounted price.

(This tutorial is part of our AWS Guide. Use the right-hand menu to navigate.)

How AWS Spot Instance Billing Works

AWS Spot Instance pricing structure offers up to 90 percent discount on the On-Demand instance service. The service is identical to the regular EC2 instance offering except that it can be interrupted when the pricing increases the amount specified by the customer or when the capacity is no longer available. The company evaluates the supply and demand trends to set a price for the Spot Instances and changes based on instance availability. The customer gives their maximum bid for the Spot Instance and continues to receive the market spot price as long as the latter doesn’t exceed the customer’s bid. The market spot price is determined at the beginning of the instance-hour and billed on a per-second basis to the customer. As a result, the pricing is usually stable for at least one instance-hour and only changes as long as demand-supply gap justifies the discounted price. The service gets interrupted differently based on the capacity availability of the particular instance type and Availability Zone, although AWS claims the average interruption frequency is less than 5 percent.

As a simple example, consider that an instance is billed at 1 USD per hour for a regular On-Demand pricing structure. With the Spot Instance pricing structure, assuming a low demand and high supply availability of the same instance, AWS sets the pricing for the same instance at 0.3 USD per hour. A customer willing to purchase the instance bids 0.6 USD per hour as part of the Spot Instance pricing structure. The customer will then be able to use this instance at the spot market price of 0.3 USD per hour until the instance is no longer available (due to higher demand from customers opting to pay the On-Demand tariff for it) or the number of Spot Instance customers for the same instance option increases and AWS adjusts its spot market price at higher than the customer’s original bid of 0.6 USD per hour. Indeed, the customer could have bid the maximum On-Demand price and continue to take advantage of the Spot Instance discount as long as the spot market is lower, which will always be the case as long as the instance is sold within the Spot Instance billing model. This means that customers need to optimize their choice of Spot Instance bid based on their budget, value to business as well as the alternate pricing models available on the AWS store. Here’s a list of best practices to quickly guide you through this goal: