4 ms·
this actually sounds interesting. do you precreate the workers beforehand and then just keep them in a stopped state?
by _zoltan_ 2y ago
this actually sounds interesting. do you precreate the workers beforehand and then just keep them in a stopped state?
- torginus 2y agoyeah. one of the goals was startup time, so It made sense to precreate them. In practice we never ran out of free machines (and if we did, I have a cdk script to make more), and inifnite scaling is a pain in the butt anyways due to having to manage subnets etc. Cost-wise we're only paying for the EBS volumes for the stopped instances which are like 4GB each, so they cost practically nothing, we spend less than a dollar per month for the whole bunch.
- zild3d 2y agoWarm pools are a supported feature in AWS on auto scaling groups. Works as you're describing (have a pool of instances in stopped state ready to use, only pay for EBS volume if relevant) https://aws.amazon.com/blogs/compute/scaling-your-applications-faster-with-ec2-auto-scaling-warm-pools/ https://aws.amazon.com/blogs/compute/scaling-your-applicatio...
- zerd 2y agoIf you want even fast startups restarting stopped instances is apparently faster https://depot.dev/blog/faster-ec2-boot-time https://depot.dev/blog/faster-ec2-boot-time
- merb 2y agoI always thought that stopped instances will cost money as well?!
- torginus 2y agoYou're only paying for the hard drive (and the VPC stuff, if you want to be pedantic). The downside is that if you try to start your instance, they might not start if AWS doesn't have the capacity (rare but have seen it happen, particularly with larger, more exotic instances.)
- rfoo 2y ago> we spend less than a dollar per month for the whole bunch This does not change the point, I'm just being pedantic, but: 4GB of gp3 EBS takes $0.32 per month, assuming a 50% discount (not unusual), less than a dollar gives only... 6 instances.