CPU utilization is the percentage of processor capacity a workload uses during a measurement interval. In AWS, CloudWatch collects CPUUtilization and other metrics so you can monitor capacity and respond to changing load. section 11.5 section 17.2.2
High utilization can mean long waits, not just a busy processor. Wait time can rise sharply around 80–90% utilization because work arrives unevenly. Leave capacity for bursts rather than treating 100% as an operating target. section 11.5.1
Check what a percentage measures before acting on it. An ElastiCache host can show low overall CPU utilization while a single-threaded Redis process saturates one core. Monitor EngineCPUUtilization for that process; also watch swap usage, which can hurt an in-memory cache’s performance. section 11.5.1
To scale an EC2 application with CPU utilization:
- Choose a CloudWatch metric and scope it to the instances in an Auto Scaling group. An alarm can evaluate a statistic over specified periods against a threshold. section 17.2.2
- Connect the alarm to a scaling policy that changes the group’s desired instance count, or use target tracking to specify a CPU target without defining scaling steps and thresholds yourself. section 17.2.2 section 17.3.1
Scaling a WordPress site
A WordPress deployment places Apache web servers behind a load balancer, with shared data in RDS and EFS. Its Auto Scaling group uses target tracking with ASGAverageCPUUtilization set to 70. As CPU load changes, the policy adjusts the number of EC2 instances. The load balancer distributes requests across them. section 17.3.1 section 17.3
Listing 17.6 Creating a scalable, HA WordPress setup, part 3
ScalingPolicy:
Type: 'AWS::AutoScaling::ScalingPolicy' #1
Properties:
AutoScalingGroupName: !Ref AutoScalingGroup #2
PolicyType: TargetTrackingScaling #3
TargetTrackingConfiguration: #4
PredefinedMetricSpecification: #5
PredefinedMetricType: ASGAverageCPUUtilization #6
TargetValue: 70 #7
EstimatedInstanceWarmup: 60 #8
See the CloudFormation scaling policy’s predefined average-CPU metric, target value of 70, and instance warmup setting. section 17.3.1







