Running spot instances effectively with Amazon EKS

Programming - Mar 31, 2024

I know this is a little outside the normal scope of CSS-Tricks stuff, but I find the whole concept of spot instances fascinating. Here’s the gist from a very-non-expert (me). You can just buy and pay for web servers, for example, Amazon EC2. You can save a bunch of money if you buy them as “reserved instances” meaning you agree ahead of time you’ll need it for a long time (like a year) and prepay some or all of it.

There is a way to save way more money though, and that’s to use spot instances. Blake Stoddard:

Spot instances give us the ability to get the compute we need at an even deeper discount than a 1-year RI or savings plan rate would, without the same commitment. Combine the price with seamless integration with auto-scaling groups and it makes them a no-brainer for most of our workloads.

The big catch with spot instances? AWS can take them back from you with a two-minute notice.

With a spot instance, you ask for a web server and get one, but it can be ripped away from you at any time. No wonder it’s so cheap, eh?

In order to take advantage of this, you have to know what you’re doing (which rules me out, but thankfully I work with smart people). You can’t put everything on spot instances because some things need to be highly available, and that will depend on what you’re doing. But even more so than the cost savings, that’s what I like about the idea of spot instances: it teaches you to build in a resilient way. If you can build your site on a system where the servers themselves can get taken away from you at any moment and still offer a reliable service, that’s a seriously resilient foundation.

Direct Link →

Previous Next
We respect the property rights of others, and are always careful not to infringe on their rights, so authors and publishing houses have the right to demand that an article or book download link be removed from the site. If you find an article or book of yours and do not agree to the posting of a download link, or you have a suggestion or complaint, write to us through the Contact Us .
Read More