3
votes

I am new to spot instance use in amazon web services. I have a basic question. If a user acquires certain number of spot instances at a bid price and the SPOT price increases in the subsequent hours, will he loose all the spot instances or some of them? Also is there any other cloud providers providing this kind of service? can we dynamically increase or decrease our bid while our spot instance is running?

In case of spot instance, what is the meaning of "shut down your instance" when spot price goes above your bid price. Is the node still accessible for shutdown or its just a logical command to perform so that you can create another spot instance elsewhere in future? what is the benefit of this "shutdown spot instance" for a user? is there a way to tell for automatic shutdown of spot instance when the bid is less than spot price and amazon terminated the spot instance?

3
Have I satisfactorily answered your question?Drew Khoury

3 Answers

8
votes

Question 1

If a user acquires certain number of spot instances at a bid price and the SPOT price increases in the subsequent hours, will he loose all the spot instances or some of them?

You will lose all of them. Why do you lose all of them? The rules apply to all the instances in this scenario as they all have the same bid price.

http://aws.amazon.com/ec2/spot-instances/

If the Spot price exceeds your max bid or there is no longer spare EC2 capacity in a given Spot pool, your instances will be terminated.

It's also important to note:

You should always be prepared for the possibility that your Spot Instance may be interrupted.

Question 2

Also is there any other cloud providers providing this kind of service?

Not that I know of. I haven't seen the other big players (like Rackspace) offer spot instances.

Question 3

In case of spot instance, what is the meaning of "shut down your instance" when spot price goes above your bid price.

Your instances gets terminated without notice. This means you have to build fault tolerant applications and be prepared for your EC2 to fail at any moment.

Question 4

what is the benefit of this "shutdown spot instance" for a user?

I assume you are talking about the following "When your bid exceed the Spot Price, your Spot instance is launched and your instance will run until the Spot Price exceed your bid (a Spot interruption) or you choose to terminate them."

Terminating your EC2 is something you would do when you're finished with your Spot Instance, otherwise you will be charged for each hour that it's running.

Question 5

is there a way to tell for automatic shutdown of spot instance when the bid is less than spot price and amazon terminated the spot instance?

You have a few options here:

  1. AWS have an API where you can get information on any of your instances. You can monitor the status through your own code that takes advantage of the API.

  2. You could use CloudWatch to alert you on the EC2 state change.

  3. For reporting you also have access to your Spot Instance Data Feed.

0
votes

In short answer if another user is bidding more for the instances and there are no more spare available instances then the spot price increases and the first group of instances that fall below that price are SHUTDOWN instantly.

Quoting http://aws.amazon.com/ec2/spot-instances/

Spot Instances allow you to name your own price for Amazon EC2 computing capacity. You simply bid on spare Amazon EC2 instances and run them whenever your bid exceeds the current Spot Price, which varies in real-time based on supply and demand.

0
votes

2016 follow up for those who find this answer via a search engine. AWS will only terminate enough of your instances to satisfy the higher bidders request(s).

For example (from recent real experience) say I run 20 large instances (244GB RAM) at a $1 dollar bid. If the spot price goes to exactly $1 it indicates (AFAICT) that I'm using all available instances of this type and possibly taking instances from lower bidders. While using these instances I submit a $4 bid for 2 instances the same type. The spot price goes up over $1 but I will only lose 2 (at random) of my original instances. The spot system only terminates enough instances to satisfy my own higher bid. The rest of my original instances will continue to run and be charged $1.

This makes sense from AWS' perspective because they don't want to maximise the total income from their hardware. Terminating all of my $1 instances would reduce their revenue needlessly.