Spot instances are a great way to save money for your EC2-based workloads on AWS. They allow using Amazon’s spare capacity for a discounted cost, up to 80% cheaper than a standard on-demand price.#

Admittedly that sounds tempting, but it is important to remember this option is not without risk. It may happen that AWS will need that capacity back and our resources get unexpectedly terminated. Your application needs to be fault-tolerant and flexible to handle this kind of disruption. 

To minimize the risk of running out of hardware, it is a good idea to run a mixture of on-demand and spot instances. That can be easily achieved through auto-scaling groups and launch templates. 

Also, it is possible to implement automation around the termination process. AWS triggers notifications in advance that can be then parsed by e.g. AWS Lambda and perform appropriate actions to ensure the continuity of your application.

There is no “one-fits-all” spot instance strategy, so it is important to review your workload patterns and requirements before any decisions are made.
0