AutoSpotting
AutoSpotting copied to clipboard
Ability to include randomness when calculating spot bid price
Github issue
Issue type
- Feature Idea
Build number
master
Summary
AutoSpotting already features the ability to customize SpotPricePercentageBuffer
to allow bidding relative to the current spot price. But bidding the same price for every spot instance in an ASG means a lot of your instances may get interrupted at the same time should the price increase. It would be nice if AutoSpotting included some configurable amount of randomness in the bid price for each instance. This way, instances would all be purchased at different rates, which would decrease the chances of them all becoming too expensive at the same time.
This can be mitigated by using a mix of different instance types and hoping their pricing curves differ enough such that they won't all exceed your threshold at the same time.
Steps to reproduce
- Set bidding policy to
aggressive
- Notice AutoSpotting set all bid prices to 10% above spot price
- All instances get terminated at the same time when spot price rises 10%
Expected results
Instances get terminated slowly as prices change.
Actual results
Instances get terminated all at once.
Great idea, thanks!
If you look at the spot pricing graphs since a couple of years ago there's basically just a daily correction of a very small increment.
In practice using the aggressive bidding policy makes little sense anymore, unless you actually want to trigger replacements in order to test some code paths.
We could determine that increment and instead of using a percentage we can bid a random times that value over the current spot price:
bid_price := current_price + daily_increment*random(X)
,
where X could be a small configurable integer value, with a default around 10 or so, so basically we spread the termination of instances over a number of days
If you look at the spot pricing graphs since a couple of years ago there's basically just a daily correction of a very small increment.
I think AWS technically only guarantees the price for an hour. Some of the more volatile instances will change prices multiple times a day, although it's nothing like the swings before the Spot bidding overhaul.
In practice using the aggressive bidding policy makes little sense anymore, unless you actually want to trigger replacements in order to test some code paths.
This is exactly what I've been using it for. I think there also may be case to use it instead of OnDemandPriceMultiplier, but I don't know what it would be.
This is no longer relevant, Spot prices are no longer in a bidding model so won't trigger instance terminations anymore