amazon web services - How to configure EC2 autoscaling based on multiple limits on same metric? -
my primary requirement follows:
when cpu consumption on instance exceeds 50 % adjust capacity of autoscaling group 5 instances, when cpu consumption exceeds 80% adjust capacity 10 instances.
however if use cloudwatch alarms set capacity can imagine following race condition:
- 5 instances exist
- cpu consumption exceeds 80 %
- alarm triggered
- capacity changed 19 instances
- cpu consumption drops below 50 %
- eventually cpu consumption again exceeds 50% capacity changed 5 instances (which don't want happen)
so ideally happen in response alarm triggers ensure capacity altleast corresponding threshold.
i aware can done manually setting capacity through aws sdk - triggered in response lifecycle events monitored supervisor, there better approach, preferably 1 not require setting additional supervisors or webhooks alarms ?
i suggest looking aws lambda function, triggered sns message cloudwatch - should give free reign put logic scaling decision want.
good luck!
Comments
Post a Comment