AWS News Blog

New – EC2 Spot Blocks for Defined-Duration Workloads

I do believe that there’s a strong evolutionary aspect to the continued development of AWS. Services start out simple and gain new features over time. Our customers start to use those features, provide us with ample feedback, and we respond by enhancing existing features and building new ones. As an example, consider the history of Amazon Elastic Compute Cloud (EC2) payment models. We started with On-Demand pricing, and then added Reserved Instances (further enhanced with three different options). We also added Spot instances and later enhanced them with the new Spot Fleet option. Here’s a simple evolutionary tree:

Spot instances are a great fit for applications that are able to checkpoint and continue after an interruption, along with applications that might need to run for an indeterminate amount of time.  They also work really well for stateless applications such as web and application servers and can offer considerable savings over On-Demand prices.

Some existing applications are not equipped to generate checkpoints over the course of a multi-hour run. Many applications of this type are compute-intensive and (after some initial benchmarking) run in a predictable amount of time. Applications of this type often perform batch processing, encoding, rendering, modeling, analysis, or continuous integration.

New Spot Block Model
In order to make EC2 an even better fit for this type of defined-duration workload, you can now launch Spot instances that will run continuously for a finite duration (1 to 6 hours). Pricing is based on the requested duration and the available capacity, and is typically 30% to 45% less than On-Demand, with an additional 5% off during non-peak hours for the region. Spot blocks and Spot instances are priced separately; you can view the current Spot pricing to learn more.

You simply submit a Spot instance request and use the new BlockDuration parameter to specify the number of hours your want your instance(s) to run, along with the maximum price that you are willing to pay. When Spot instance capacity is available for the the requested duration, your instances will launch and run continuously for a flat hourly price. They will be terminated automatically at the end of the time block (you can also terminate them manually). This model is a good for situations where you have jobs that need to run continuously for up to 6 hours.

Here’s how you would submit a request of this type using the AWS Command Line Interface (CLI):

$ aws ec2 request-spot-instances \
  --block-duration-minutes 360 \
  --instance-count 2 \
  --spot-price "0.25" ...

You can also do this by calling the RequestSpotInstances function (Console support is in the works).

Here’s the revised evolutionary tree:

Available Now
You can start to make use of Spot blocks today. To learn more, read about Using Spot Blocks.

— Jeff;