|
|
|
|
|
by DVassallo
2858 days ago
|
|
The way I've been happiest using EC2 Auto Scaling was to have a single cron-job continuously calculating how many instances I should be running, and it sets the desired capacity manually with the Auto Scaling API[1]. This may seem to defeat the purpose of Auto Scaling, but it's actually much more convenient than spinning up/down EC2 instances with the EC2 API. You get to precisely control how to scale, and won't be at the mercy of the Auto Scaling heuristics. [1] https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-man... |
|
We were doing exactly this - but we had a flaw: we didnt handle the case when the AWS API was actually down.
So we were constantly monitoring for how many running instances we had - but when the API went down, just as we were ramping up for our peak traffic - the system thought that none were running because the API was down - so it just kept continually launching instances.
The increased scale of instances pummeled the control plane with thousands of instances all trying to come online and pull down their needed data to get operational -- which them killed our DBs, pipeline etc...
We had to reboot our entire production environment at peak service time...