There's an excellent implementation using AWS lambda to manage spot instances at <a href="https://github.com/AutoSpotting/AutoSpotting" rel="nofollow">https://github.com/AutoSpotting/AutoSpotting</a><p>What's fantastic about the autospotting implementation is:<p>1. It dynamically replaces existing instances with spot instances just by setting a tag<p>2. Rather than replacing the instance with a fixed spot instance type, it will choose the cheapest that fits the requirements.<p>3. If there are no spot instances available that fit the requirements, it will spin up on demand instances until spot instances are available.<p>If you have experience working with spot then you will know that these are really outstanding features that hopefully amazon will bake-in in the future.
Turns out this is about EC2 spot instances for ECS. How would it compare to ECS Fargate spot these days?<p>I'm also missing a discussion about designing for interruption, either by not keeping state, or by being able to shed state quickly, to be picked up by other instances.<p>Also, if you set up EC2 spot with a launch template or ASG with very differently-sized instance types (to reduce risk of running out), is there a way to even out the load coming through an ALB? The least-connections scheduling can help in some cases, but a connection might not map 1:1 to one unit of load. The ALB can use weighted balancing, but on the target group level. Dunno how easy it would be to allocate different instance sizes to different target groups and weigh them accordingly.
For service type workloads (e.g API service with 99.99% uptime SLA) we keep comparing on-demand vs. spot.<p>In reality, you would like to compare Reserved Instances as you can get 60% discount.<p>So in us-east-1:<p>- spot costs: 35-43% of on-demand<p>- RI 1 year standard: 60% of on-demand<p>- RI 3 year convertible: 46% of on-demand<p>So if you have some base load that you can commit to running for 3 years, the price gets often at spot range while not having to worry about losing capacity.<p>In-reality sometimes combining reserved for some base capacity 60% + 40% spot for spiky seems to be the winning combination for many companies.
Seems like amazon has long been transitioning spot instances away from being a method of efficiently utilizing excess capacity, towards being a discounted service for less risk-averse businesses(businesses that can accept the risk of their service being terminated at any time).<p>Even if in practice AWS never sees large spikes in compute demand and corresponding large scale instance preemption, most businesses I've worked with won't accept the risk of having OLTP systems be taken down at any time.<p>No longer does spot seem to be a service where one can get a bargain for their compute intensive offline/batch workloads that are much more tolerant of preemption.<p>Given that the spot prices seem to be very flat, and preemption is rare, amazon presumably have a fair bit of underutilized capacity, does anyone know if amazon uses this capacity themselves, or offers more aggressive spot pricing to select clients?
Great article. Cutting ec2 costs is important, especially for companies with heavy data engineering / data science workflows. Spark service providers make it easy to spin up huge clusters (100+ nodes) to perform ad hoc analyses. The costs can quickly spiral out of control, even if you're getting 3x cost savings on the spot market.<p>Some tangential thoughts:<p>* Is there an AWS API that returns the cheapest availability zone in a region for a given instance type? Or is the GUI that's screenshot in the blog the only way to see?<p>* I have seen the 90%+ cost savings for certain instance types<p>* Sometimes you lose a spot instance, look at the pricing history graph to confirm the price spike, and don't see any spike that was above your bid price... it can be frustrating
"Our backend system is built on AWS. Today I’m going to tell you how we had cut costs"<p>This is a recurring topic here on HN and it boggles me and makes me wonder if people know that there are other platforms than aws, azure and google cloud out there that are very capable and much much cheaper.<p>Unless any of the big 3 has a feature or certification you need I don't see any reason to use them at all due to the insane complexity and cost.<p>So why do you or your company who uses any of the big 3 use them if you had to cut cost at some point?
Very well written article!<p>If someone is interested in learning all the AWS concepts, here's an awesome e-book which is written by the legend Daniel Vassallo himself.<p><a href="https://gumroad.com/a/238777459/MsVlG" rel="nofollow">https://gumroad.com/a/238777459/MsVlG</a>