1 Answer
- Newest
- Most votes
- Most comments
1
You can set up a CloudWatch alarm for high CPU usage on an EC2 instance without installing any agent, as basic monitoring is built-in for EC2 instances.
Here's how to create a CPU usage alarm through the EC2 console:
- Open the Amazon EC2 console
- In the navigation pane, select "Instances"
- Select your instance and choose "Actions" > "Monitor and troubleshoot" > "Manage CloudWatch alarms"
- On the "Manage CloudWatch alarms" page, select "Create an alarm"
- For "Alarm notification", choose to configure Amazon SNS notifications. You can either select an existing SNS topic or create a new one by entering a name
- For "Alarm thresholds", configure:
- Keep "Group samples by" as "Average"
- Keep "Type of data to sample" as "CPU utilization"
- Set "Alarm when" to ">=" and enter "0.80" for "Percent" (representing 80%)
- Enter "1" for "Consecutive period" and select "5 minutes" for "Period"
- Optionally, you can add the metric data to your dashboard
- Choose "Create" to save the alarm
Alternatively, you can create the alarm through the CloudWatch console:
- Open the CloudWatch console
- Select "Alarms" and click "Create alarm"
- Choose the EC2 metric you want to monitor (select "EC2 > Per-Instance Metrics" and find your instance)
- Select the "CPUUtilization" metric
- Configure the alarm conditions:
- Set statistic to "Average"
- Set period to 5 minutes (300 seconds)
- Set threshold type to "Static"
- Set condition to "Greater than"
- Set threshold value to 80
- Configure evaluation periods
- Set up the SNS notification
- Give your alarm a name and description
- Review and create the alarm
AWS recommends monitoring CPU utilization with a threshold of 80% as a best practice, as consistently high utilization might indicate a resource bottleneck or application performance issues.
Sources
Create a CloudWatch alarm for an instance - Amazon Elastic Compute Cloud
You want to monitor your EC2 instances cpu usage and set up an alarm to trigger an SNS notification when usage exceeds 70%. | AWS re:Post
Recommended alarms - Amazon CloudWatch
answered 13 days ago
Relevant content
- asked 3 years ago