Kit Wai Chan - Fotolia


Wrangle AWS Spot Instances with Spot Fleets and save

Amazon created Spot Fleets to manage entire sets of Spot Instances, an increasingly popular choice among cost-conscious developers.

As public cloud evolves, the ways in which developers create instances also continue to change. And the use of AWS Spot Instances, once considered niche compute resources, has grown as enterprises look for ways to reduce expenses for cloud-based workloads.

Among the enormous pool of computer racks sitting in various Amazon Web Services (AWS) data centers, there is always some level of excess computing capacity. Spot Instances are idle or excess AWS compute resources that are not allocated for anything else at one particular moment in time. Amazon lets you bid on that excess capacity; if your bid is greater than the market price, you're able to use that instance until the price rises.

IT teams can acquire AWS Spot Instances for 10% of the cost of an On-Demand Instance. But that low cost comes with the risk that the resource could disappear at any moment. Managing and strategizing around vanishing instances, as well as deciding when and how to replace those instances, is challenging. This complexity has been seen as a reason why more companies have not embraced Spot Instances.

Amazon recently created Spot Fleets as a way to reduce the development costs of using Spot Instances. Spot Fleets let admins deal with the entire set of Spot Instances as a unit, rather than managing each individual instance.

Spot Instances users face two challenges:

1. Breaking a large job up into multiple, parallelizable and largely stateless smaller jobs that can be farmed out to a set of re-startable instances.

2. Maintaining a set of AWS Spot Instances.

Spot Fleets address the second challenge, as an application runs on multiple Spot Instance types. Most applications can run on multiple instance types.

With On-Demand Instances, developers choose the smallest (and cheapest) instance type satisfying an application's needs. Prices are dynamic in the Spot Instance world, and larger and faster instance types can be less expensive than smaller ones. Spot Fleets allow developers to configure a set of instance types that meet specific needs; AWS selects the least expensive current type for each new instance it creates.

The other challenge for developers is responding to instance termination. Prior to Spot Fleets, an application had to manually respond to events or periodically poll the set of running instances to determine if AWS terminated any Spot Instances. The application then had to decide how to respond. This meant either having a controller application comprising a single point of failure -- or distributed instance polling, which comes with its own set of complexities. Spot Fleets allow you to hand off this responsibility to AWS.

Google jumps on Spot Instances bandwagon

Google now offers a disappearing instance with its Preemptible VMs (PVMs). Because the price of PVMs is lower than standard instances and they can go away, they are similar to AWS Spot Instances. But PVMs have a fixed price instead of a market price. With Spot Instances, consumers pick a price based on how much they're willing to pay, along with an assessment of the current and likely future state of the spot market.

If you see that the price for the type of instance you want has been $0.007 per hour with occasional swings up to $0.01 per hour, you might decide to bid $0.011 to ride out any possible price swings. Whatever you bid, you only pay the current actual spot price -- not the price you bid. So if the spot price remains at $0.007 that is the price you pay, even if you bid a higher amount.

PVMs, on the other hand, have low, but fixed prices. Some consumers like variable market pricing because it can, if used carefully, save more money.

Next Steps

Hit a configuration sweet spot with AWS Spot Instances

Amazon ClusterK buy could boost AWS Spot Instances

Saving money in the cloud: Tips for getting the greatest ROI on AWS

Dig Deeper on Amazon EC2 (Elastic Compute Cloud) management