Probably quite a few of you use AWS with On-demand or reserved instances, but you are still afraid of the spot instances. Is it because the spot market is so unpredictable? What would you say if I told you that you can use spots without fear?
What is the spot market?
You can learn more about it on the AWS Website Simply speaking, Amazon has a lot of unused resources which you can freely bid. If your bid is higher than a current price per hour — you can use that EC2 instance, if not — it’ll be terminated.
Where do we use spots?
Everywhere! Ok, maybe it’s an overstatement, but in fact, we’re using spot instances for all stateless instances (web servers, CI/CD, cron workers etc). That’s right — each of our web servers is based on the spot instances and they are not a cause of any downtimes! Currently we use regular EC2/RDS instances only for queues, caches and DBs.
How do we actually use them?
Earlier we used Autoscaling groups with few launch
configurations (one per spot type per Availability Zone(AZ))
with spots. However, that configuration was hard to manage and
because of many problems (have you ever tried to adjust capacity
in that solution?:)) we used it only for staging environment.
And then we found maxspotter.com:)
Long story short, it’s a SaaS product which helps you optimize your cloud (AWS/ GCP) bill. We're using machine learning to predict spot prices. And those predictions are more than acceptable :-) If a current spot price per hour is higher than an on-demand price then you’ll receive an on-demand instance. But if price drops, you’ll be switched to the spot instance. It’s really simple but effective mechanism.
Spot prices can differ considerably within a single day. A regular price of C4.2xlarge is $0.498 per hour, but on 11/8 between 11:30 PM and 4:30 AM its cost increased to $5.3 comparing to the regular price below $0.15. When price increased, a part of our infrastructure was automatically switched to on-demand instances or to another spot type.
So, if you want to start using spot instances on the production — request a demo of the MaxSpotter. You won’t regret it!