I might've found a valid reason to keep using Auto Scaling Groups with Spot Instances: you can attach those to a load balancer / target group, while spot fleets can't do that as of now.
Not that it matters too much for my use case any way as my cluster is an ECS cluster and instances will get registered in target groups automatically when launching containers, but it's good to know anyway.
Edit: Apparently Spot Fleets do not support CreationPolicies either, so you're either left to use ASGs or have some fun with WaitConditions if that is needed.
Answer from Rubén Durá Tarí on Stack OverflowI might've found a valid reason to keep using Auto Scaling Groups with Spot Instances: you can attach those to a load balancer / target group, while spot fleets can't do that as of now.
Not that it matters too much for my use case any way as my cluster is an ECS cluster and instances will get registered in target groups automatically when launching containers, but it's good to know anyway.
Edit: Apparently Spot Fleets do not support CreationPolicies either, so you're either left to use ASGs or have some fun with WaitConditions if that is needed.
The major advantage of Spot Fleet is that it re-balances instances across availability zones if an AZ is experiencing a price spike. In contrast, ASG would leave you with fewer running instances than you requested.
This, along with the ability to balance across instance types and not just availability zones, makes Spot Fleets much more reliable for maintaining a target capacity than ASG. They come at an opportune time, since spot prices are seeing ever greater volatility.
That said, Spot Fleet currently is missing a lot of features afforded by ASG, as Ruben mentioned.
Does a spot fleet work better than a single instance type?
spot fleet for on demand instance
Spot Fleet vs ASG with spot
Experience with spot instance fleet stability/availability
Videos
Hi,
I've got an ASG in 2 zones. With a single instance. It should only ever run one and should start a new one if that one fails.
Today, the spot capacity disappeared in eu-west-2b and the instance stopped. Fine, I expect that, which is why I have an ASG. I'd expect it to take a minute or 2 to notice it die and another couple of minutes to launch a new instance.
However, today some time passes without a replacement instance. Long enough for users to start asking questions.
So, I investigate : After the termination, the ASG tried to start a new instance in eu-west-2b. Tried 5 times, every 2-3 minutes. Then started again, still in eu-west-2b. Another 5 times. Eventually about 20 minutes later (about 2 minutes after I get logged in and see what is going on and am still head scratching) it tries eu-west-2a. And surprise, there is capacity. Instance launches.
_Thanks_ for the delay.
IF instead of a single spot type, I use a spot fleet with multiple instance types, will it sensibly realise straight away that a certain zone/instance combo isn't going to work. Or will it sit there mindlessly trying to launch m5.large instances in eu-west-2b when there is no capacity. And keep doing that for 20 minutes before deciding to try m4.large in eu-west-2b and if there is none of that, another 20 minutes, before trying c4.large etc..... ??
(Will what should make it better actually maybe make it worse?)
Is autoscaling just not going to work right for a single instance deployment and spot? I'd be better off not using ASG and building my own autoscaling rules, with counting 503's on an ALB and if I see any, terminate and launch new. (I might not even need a lambda for that, not 100% sure if metric based autoscaling is that clever.)
tl;dr : Compared to a single instance type launch config, will using a spot fleet with multiple spot types decrease or increase my recovery time from capacity exhaustion when I want only a single instance to run?