Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup EC2 Autoscale policies along CPU monitors and it's working well.

I have occasional bursts that triggers autoscale and more servers are added.

If the servers are experiencing a burst that endures 30 minutes and two more instances are added to help with the current jobs I'd like to keep them around for 59 minutes (since I paid for 1 hour) instead of them being terminated when scaling down is triggered.

So basically I want to move the checks around the one hour mark from start and see if they are still needed, otherwise shut down. Should I play with cooldown or grace-period?

Here are the current rules (alarms not shown), as you can see I'm using the new OldestInstance termination policy.

as-create-auto-scaling-group MyASGroup \
--availability-zones us-east-1c \
--launch-configuration MyLaunchConfig \
--grace-period 300 \
--health-check-type ELB \
--min-size 1 \
--max-size 3 \
--desired-capacity 1 \
--load-balancers MyELB \
--termination-policies "OldestInstance" \
--tag ...

as-put-scaling-policy ScaleUp \
--type ChangeInCapacity \
--auto-scaling-group MyASGroup \
--adjustment=1 \
--cooldown 300

as-put-scaling-policy ScaleDown \
--type ChangeInCapacity \
--auto-scaling-group MyASGroup \
--adjustment=-1 \
--cooldown 300

Is such thing possible? Thanks.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You should adjust your cooldown period for the ScaleDown policy to keep your instances up for longer. Grace-period should be set to the amount of time it takes to spin-up your instance, so no need to adjust it (if your instances are up in less than 300 seconds). Once you have your policies in place, you can test them by using the as-execute-policy command with the --honor-cooldown parameter. This will allow you to make sure that cooldown works they way you want, without having to wait for the load conditions to be met.

share|improve this answer
    
Thanks, I changed the cooldown of the scale down policy. Do you know what purpose servers the cooldown on the scale up? –  Claudio Poli Feb 4 '13 at 14:31
    
I would use it if I wanted to be very responsive to scale up (like CPU greater than 60 percent for one minute), but wanted to limit the rate that my instances scaled up (want to wait 30 minutes for the second scale up. –  Edwin Feb 4 '13 at 19:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.