klahnakoski / SpotManager

Find cheapest spot instance prices, bid, use, and teardown when done
Mozilla Public License 2.0
17 stars 3 forks source link

Diverisify the instance types #13

Closed lexelby closed 9 years ago

lexelby commented 9 years ago

When building a large fleet of spot instances, I'm concerned that SpotManager might begin to cause price fluctuations. The current algorithm finds the best price per utility and then attempts to bid on all of the utility it needs in that instance type. It may compete with itself, driving the price up beyond what other instance types cost, ultimately giving itself a worse deal. This is just speculation; I have yet to see this happen.

One potential solution would be to add a parameter that limits the number of instances of each type that may be requested in one run. That will cause SpotManager to spread its requests over several different types if lots of new utility is required at once.

lexelby commented 9 years ago

Okay, so maybe not. I just requested 50 m3.larges and got them without impacting the price.

klahnakoski commented 9 years ago

I had the same idea, but for different reason: To reduce the impact of price fluctuations (caused by you, or not). My concern is that when all the instances are of the same type, a price spike can bring your whole fleet down. Having a number, like expected_instability (a measure of how much instability you can handle (as %)) can be used to diversify the instance types, despite lower utility, to mitigate the negative effects of price spikes.

lexelby commented 9 years ago

Very good point. I'm less worried about losing my whole fleet, especially since if I run this thing as a cron job, new instances will pop right up. But I could see workloads that would be more sensitive to termination.

lexelby commented 9 years ago

This is pretty well solved by #14.