From the traffic and workloads that the system receives and sends each day, ASG can “predict” the future traffic and workloads for the upcoming days. This helps ASG respond better by launching or terminating instances accordingly. Typically, Predictive Scaling is used in combination with other types of scaling.



PredictCPUUtilizationAt15Percent (you can choose any name)
{
"CustomizedLoadMetricSpecification": {
"MetricDataQueries": [
{
"Id": "cpu_sum",
"MetricStat": {
"Metric": {
"Namespace": "FCAJ Custom Metrics",
"MetricName": "WSCustomCPUUTILIZATION",
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": "FCAJ-ASG"
}
]
},
"Stat": "Sum"
},
"Label": "Total CPU Utilization in ASG",
"ReturnData": true
}
]
}
}
{
"CustomizedScalingMetricSpecification": {
"MetricDataQueries": [
{
"Id": "cpu_avg",
"MetricStat": {
"Metric": {
"Namespace": "FCAJ Custom Metrics",
"MetricName": "WSCustomCPUUTILIZATION",
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": "FCAJ-ASG"
}
]
},
"Stat": "Average"
},
"Label": "Average CPU Utilization in ASG",
"ReturnData": true
}
]
}
}

Similarly to the previous two steps, I will add custom metric JSON for Capacity metric.
{
"CustomizedCapacityMetricSpecification": {
"MetricDataQueries": [
{
"Id": "capacity_avg",
"MetricStat": {
"Metric": {
"Namespace": "FCAJ Custom Metrics",
"MetricName": "WSCustomGroupInstances",
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": "FCAJ-ASG"
}
]
},
"Stat": "Average"
},
"Label": "Number of instances in ASG",
"ReturnData": true
}
]
}
}

If you configured 2.6 - Prepare metrics for predictive scaling earlier, after completing the setup, you will see two charts displayed.

Similar to Dynamic scaling, this Pre-launch instances setting will affect when the instances will be launched. For example, if ASG predicts a peak at 23:00, it will launch instances at 22:59, according to the configuration.


The chart is in UTC+0, and we are in UTC+7, so you’ll need to add 7 hours when reading these charts.

To understand what this number represents, look at the chart on the right.



We can combine Predictive Scaling with Dynamic Scaling or other scaling types to increase ASG’s flexibility and the system’s reliability. For systems with consistent load over time, using predictive scaling is also a reasonable approach.