Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What price do I eventually pay for a AWS spot-instance and do I drive up the prices?

I would like to create an auto scaling group [ASG] with spot instances as a supplement to my production ASG that has on-demand instances.

After reading this post , I would like to mimic it but maybe without the dynamic bidding and auto-scaling at first.

So, I was wondering , if I just set the bid price for the spot instances equal to the on-demand price of the instance I use [m3.large] , would I be paying the lowest bid price [for that instance, in the region, in that hour] ??

So if the spot price is $0.01 and my max bid in the ASG is $0.067 , I would be paying $0.01 for every spot instance the ASG launches, right?? [That is what I understood from the AWS docs but I would like a confirmation]

And finally, by this kind of thinking [that I suppose I am not the only one to have] do I drive the spot instance prices up ?

like image 578
Kostas Demiris Avatar asked May 27 '16 09:05

Kostas Demiris


1 Answers

Spot instance prices are different among Availability Zones. You pay based on the market price (M) where your instances are in.

You set a bid price (B). The payment rule is:

  • If the market price is lower than or equal your bid (M <= B) and there are free resources on spot-instances pool, you pay the market price.
  • If the market price is higher than your bid (M > B, outbid) or there are no free resources on spot-instances pool, your spot-instances will be terminated and no need to pay the current partial hour. You only need to pay the full hours that you used.
  • If you run spot-instances less than an hour and you terminate it by yourself, you need to pay for that partial hour.

Your bid is only the maximum amount that you want to pay for the spot-instances.

For more detail, you can see the official documentation. The market prices are driven by availability free resources and market demand.

For a bidding strategy, you can consult Spot Bid Advisor. In that page, you can find which instance types has lower outbid frequency based on the bid.

Added as per @Michael's suggestion on comment below:

The current market price is the lowest bid among all currently running instances. As an illustration, let say there were 3 instances were available (maybe more in the real case), and there were 4 bids for $1, $2, $3, and $5, the three highest bidders would have running instances, and the market price would be $2. So, your bid price may drive the spot instance indirectly if you are a winning bidder and there are more open bids than available spot instances.

like image 62
Edward Samuel Avatar answered Sep 19 '22 16:09

Edward Samuel