Amazon EC2 – Understanding Spot Price vs On-Demand Price

amazon ec2amazon-web-services

I am a little confused by Amazon EC2 Spot price and on demand price.

For example, an On-demand windows instance's price is $0.07 per hour.
If I bid on the "spot requests", Do I put down price lower than on-demand price?

Can spot price higher than on-demand price? say $0.08 per hour
If so, why do I need to buy it from spot price?

Is it only for the reason that Amazon can guarantee that I will have my instances ready on the date I specific with the spot price, which on-demand service can not assure my instances will be available at that time(Amazon doesn't have enough servers by that time)??

Thanks!!!

Best Answer

It is my understanding that Spot Instance pricing can be higher than On-Demand pricing in the case where a few users put in a high price to get access to a large number of servers for a short amount of time (usually only 1 hour). See page 18 of the Introduction to Spot Instances document:

Access Large Pools of Compute Capacity: Spot Instances can be used to help you meet occasional needs for large amounts of compute capacity (note that the default limit for Spot Instances is 100 versus the default limit of 20 for On-Demand Instances.) If your needs are urgent, you can specify a high maximum price (possibly even higher than the On-Demand price), which will raise your request’s relative priority and allow you to gain access to as much immediate capacity as possible given other requests and the Spot Instance capacity available at the time. While Spot Instances are generally not suitable for steadystate tasks such as serving web content, they can be used as a valuable source of instance capacity even for steady state applications when applications have urgent computing needs due to unanticipated or short-term demand spikes.

You can read more about spot instances and On-Demand vs Reserved vs Spot but basically here are your options:

  1. If you need an always-on server for a long period of time (1 year or 3 years) choose a Reserved Instance for a "bulk discount". By paying up front Amazon can better estimate capacity needs and will guarantee that your server is available for the specified amount of time.

  2. If you need a server that is always-on but for less than 1 year choose a On-Demand instance for your primary or master nodes. These take precedence over Spot instances and are almost always available whenever needed (up to 20, as indicated above). Once your instance is running it will not be terminated by Amazon unless the node has a hardware issue, in which case you will be moved to another node.

  3. If your workload can benefit from extra instances but you do not want to pay the full On-Demand price then you can request Spot Instances for secondary or slave nodes. Spot instances are priced based on excess EC2 supply and spot instance demand, both of which are highly dynamic. There is no guarantee that a spot instance will run (even with a price higher than the On-Demand price), and your server instance can be terminated by Amazon at anytime (to be used by a higher paying Spot instance or an On-Demand instance). This requires your process to be re-entrant and that you save your work frequently.