Michele Valotti
Michele Valotti

Reputation: 45

aws spot instances are evicted much sooner and more often than expected

I am trying to use aws spot instances (m5.large in eu-west-2 region) with a maximum bid equal to the price of on demand instances. According to https://aws.amazon.com/ec2/spot/instance-advisor/ these instances should have a < 5% frequency of interruption, however, after launching 40 such instances this morning, I have found that within the hour 34 of them were evicted by aws ("instance-terminated-no-capacity" according to the spot requests page on the ec2 dashboard).

This eviction rate looks much too high compared to both amazon's own advisor and other users experiences. Does anybody know what could be causing this behaviour, if there is any better way to debug it or predict it, or if this is just what I should expect from spot instances?

Thank you!

Upvotes: 4

Views: 1987

Answers (2)

Andrew
Andrew

Reputation: 33

In my experience spot interruption is highly variable, and for some instances more or less likely at different times of the day.

If you need 40 instances and they do not need to be in the same availability zone (AZ) to each other you might reduce the chance of a mass interruption of all/most instances if you spread the machines across different AZs within the region as each availability zone has its own pool of machines. Although you will likely increase the chance that some machines will be interrupted.

Note this is not an option if you are using EMR, then they have to be in the same AZ.

Upvotes: 1

Sam
Sam

Reputation: 4284

Actually, for m5.large instance in eu-west-2 region(Oregon) it's 5%-10% frequency of interruption, so you can expect a max of 10%. I'm not saying that issue you are facing is because of this.

AWS terminates your spot instances because of any of these reasons,

  1. The Spot price is above the maximum price.
  2. There isn't enough capacity.
  3. Amazon EC2 can't meet the constraints you placed on your Spot request.

In your case, since you are seeing instance-terminated-no-capacity message it is definitely because of the second reason. Since you've asked for 40 such instances, the amazon spot instance pool might not have enough capacity at that time.

The capacity of available spot instances pool depends on the demand for regular instances, and when users ask for regular on-demand instances, AWS will start terminating spot instances to fulfil those requests if there is not enough capacity

Upvotes: 2

Related Questions