Scale your Private Access Connector VM instances based on metric thresholds by creating dynamic scaling policies.
Procedure
- Verify that EC2 detailed monitoring is enabled for your Auto Scaling
group.
Important
Automatic scaling requires EC2 detailed monitoring which incurs charges. For more information, see Amazon CloudWatch documentation.- On the stack screen you just created, click the Resources tab, and then click the Physical ID in the LaunchConfig row.
- On the Launch configurations screen that appears,
view the Monitoring status in the
Details section.
-
True: EC2 detailed monitoring is enabled. Go to step 3.
-
False: EC2 detailed monitoring is not enabled. Go to step 2.
-
- Change the monitoring interval in the CloudFormation template.
- Select your stack from CloudFormation.
- Click Update, and click Next.
- Select 1min from the MonitoringGranularity drop-down list and click Next.
- Click Next and Submit.
- Enable EC2 detailed monitoring for all existing VM instances.
- On the overview screen of the Auto Scaling group, click the Instance Management tab.
- Click the instance ID of the instance you want to update.
- On the instance summary page, click the Monitoring tab, and then click Manage detailed monitoring in the upper right.
- On the Detailed monitoring screen that appears, select Enable detailed monitoring, and click Confirm.
- Repeat steps 3b to 3d to enable detailed monitoring for other existing instances.
- Go to the CloudWatch service and create two CloudWatch alarms for scaling out
and scaling in.The CloudWatch alarms are used to create dynamic scaling policies in the later step.
- On the Alarms screen, click Create alarm in the upper right.
- On the Specify metric and conditions screen, click Select metric, and then click EC2 in the Metrics section on the Browse tab.
- Click By Auto Scaling Group, locate and select CPUUtilization for the desired Auto Scaling group from the drop-down list, and then click Select metric.
- Specify the following field.FieldSettingMetricStatisticAveragePeriod1 minuteConditionsThreshold typeStaticWhen CPUUtilization isGreaterthan...
-
80 (suggested) for 2 virtual CPUs
-
70 (suggested) for 4 virtual CPUs
Datapoints to alarm5 out of 5 -
- Click Next.
- On the Configure actions screen, click Remove in the Notification section, and then click Next.
- On the Add name and description screen, specify a name and a description for the alarm, and then click Next.
- Confirm the settings and click Create alarm.
- Repeat steps a to h to create another alarm for scaling in with the
following metric and condition field settings.FieldSettingMetricStatisticAveragePeriod1 minuteConditionsThreshold typeStaticWhen CPUUtilization isLowerthan...
-
15 (suggested) for 2 virtual CPUs
-
10 (suggested) for 4 virtual CPUs
Datapoints to alarm10 out of 10 -
- Create dynamic scaling policies.
- Go back to the overview screen of the desired Auto Scaling group, and then click the Automatic scaling tab.
- Click Create dynamic scaling policy.
- Create a policy for scaling out by specifying the following fields and
clicking Create.FieldSettingPolicy typeSimple scalingScaling policy nameA unique name to identify the policyCloudWatch alarmThe CloudWatch alarm created for scaling outTake the actionAdd 1 capacity unitsAnd then wait600
- Repeat steps b and c to create another policy for scaling in with the
following field settings.FieldSettingPolicy typeSimple scalingScaling policy nameA unique name to identify the policyCloudWatch alarmThe CloudWatch alarm created for scaling inTake the actionRemove 1 capacity unitsAnd then wait1200