RightScale Blog

Cloud Management Blog
RightScale 2015 State of the Cloud Report
Cloud Management Blog

Bid for Your Instances!

Bid for Your Instances!

We're clearly witnessing a year-end release finale at AWS with another big release tonight: EC2 spot instance pricing. Spot instance pricing is the third pricing model introduced by Amazon after the original per-hour price (now called "on-demand"), then the "reserved" instance pricing and now a supply and demand driven "spot" pricing. As far as I know, this is the first step on a large scale towards "market pricing" for computing based on offer and demand. I know many people have been dreaming about something like this and a few startups have started to offer a compute market of some sort. But with Amazon's offering it is now available on a large scale to anyone!

How it works is simple yet complex. You can read the official product pageJeff Barr's blog, and Werner's blog. Here's my attempt at explaining it. AWS publishes a spot price for each instance size in each region. The spot price is the per-hour cost of a server and if you launch a spot price server now that's what you pay for the next hour. So instead of $0.10/hr for a small server you might only pay $0.03/hr if that's the current spot price. AWS adjusts the spot price periodically based on the idle capacity available, so the price might be low at night or week-ends when many sites auto-scale down and it might be high during the day when everything is busy.

Now comes the complex part. You don't just launch a spot instance and forget about it, you actually specify a maximum price you are willing to pay and for each hour you have your server running you pay the spot price current at the start of the hour. As the spot price continues to vary while your instance is running this maximum becomes very important because should the spot price exceed your maximum then your instance will be terminated by AWS! It's also possible to work the maximum price in reverse: specify a price lower than the current spot price in the evening and your request stays queued until the spot price drops below what you specified and AWS then automatically launches your instances. You can revise your maximum at any time, so if at 4am the spot price has not dropped enough you can raise your max so your instances get to run before sunrise.

It should be clear from the way the spot pricing functions that this is intended for transient compute capacity. For your database instances you should carefully stay with the on-demand or reserved instances, but for late night batch jobs where it doesn't matter whether they run a bit earlier or later the spot pricing can save quite some money.

One thing that is not obvious at the outset is what would motivate Amazon to keep the price down. Part of the answer lies in the fact that instances whose max bid drops below the current spot price get terminated, thus if the price goes up too much, too many instances get terminated which results in less revenue. So there is a balance between more instances at a lower price and fewer instances at a higher price. But I'm sure it's a lot more complex than that.

We will be supporting spot pricing in the RightScale platform over the coming months and we're curious about the functionality our customers would like to see in that respect. There are a lot of opportunities for automation here!