跳至內容

How do I identify the EC2 instances that use the most CPU with CloudWatch Metrics Insights?

2 分的閱讀內容
0

I want to use Amazon CloudWatch Metrics Insights to identify the Amazon Elastic Compute Cloud (Amazon EC2) instances with the highest CPU usage.

Resolution

To use CloudWatch Metrics Insights to identify the Amazon EC2 instances that use the most CPU, complete the following steps:

  1. Open the CloudWatch console.

  2. In the navigation pane, choose Metrics, and then choose All metrics.

  3. Choose the Multi source query tab.

  4. Choose Add query, and then choose EC2.

  5. Select the Top 10 instances by highest CPU utilization query.
    Note: The Builder view shows the Metric namespace, Metric name, Filter by, Group by, Order by, and Limit options. The Editor view shows the same options in query format.
    Example query in the Editor view:

    SELECT MAX(CPUUtilization)FROM SCHEMA ("AWS/EC2", InstanceId)
    GROUP BY InstanceId
    ORDER BY MAX () DESC
    LIMIT 10
  6. Choose Run in the Editor view, or Graph query in the Builder view.

Note: By default, the query shows you the top 10 instances with the highest CPU usage in your AWS account for your AWS Region. To increase the number of instances, change the value for Limit.

Related information

Query your CloudWatch metrics with CloudWatch Metrics Insights

Amazon EC2 examples