How do I diagnose high CPU utilization on my EC2 Windows instance when my CPU is not being throttled?

4 minute read
0

My Amazon Elastic Compute Cloud (Amazon EC2) Windows instance is experiencing high CPU utilization, but my instance's CPU is not being throttled. How can I diagnose the high CPU utilization?

Short description

You can use Task Manager from your instance to see the processes that are using the most CPU. If necessary, you can use Performance Monitor or Process Explorer to discover the processes that are causing high CPU utilization.

After you determine the specific process causing high CPU utilization, you can troubleshoot that application.

Resolution

Use Task Manager to identify the source of high CPU utilization

  1. Connect to your instance using Remote Desktop Protocol (RDP).
  2. Open Task Manager, and then select the CPU column to sort by CPU.
  3. Research any processes with high CPU utilization to determine whether they are using the expected amount of CPU.
  4. Troubleshoot any applications that are using more CPU than expected.

If all applications are using the expected amount of CPU, consider changing instance types. For more information, see How do I get more CPU and memory for my EC2 Windows instance?

Use Process Explorer to identify the source of high CPU utilization

Process Explorer is a SysInternals utility provided by Microsoft. To use Process Explorer, follow these steps:

  1. Download Process Explorer to your instance.
  2. Launch the application as an administrator.
  3. Select the CPU column to sort processes by usage.
  4. Choose View, Show Process Tree to view the parent-child relationship between processes.

Use Performance Monitor to identify the source of high CPU utilization

If you still can't determine the cause of the high CPU utilization, use Performance Monitor and the Performance Analysis of Logs (PAL) tool (optional). Performance Monitor is a built-in Windows tool.

To use Performance Monitor, follow these steps:

  1. Connect to your instance using RDP.
  2. Open Performance Monitor, and then expand Data Collector Sets.
  3. Open the context (right-click) menu for User Defined, and then choose New, Data Collector Set.
    For Name, enter a name for the new data collector set.
    Choose Create manually (Advanced).
  4. Choose Next.
  5. For Create data logs, select Performance Counter, and then choose Next.
  6. Choose Add.
    For Available counters, choose Process, % Processor Time.
    For Instances of selected object, choose All instances.
    Choose Add.
    Repeat this step for any other performance counters that you want to add.
  7. Choose Ok.
  8. (Optional) Set Sample interval and Units to your preferred values.
  9. Choose Next.
  10. Choose a location with at least 1 GiB of free space to store the data, and then choose Next.
  11. Choose Save and close, and then choose Finish.
    Note: If the CPU is spiking, choose Start this data collector set now, and then choose Finish.

After the performance monitor tool completes the data collection, you can open and review the report to determine which processes are using the instance CPU. Then, use that information to troubleshoot the specific application that's using the CPU.

(Optional) Use Performance Analysis of Logs (PAL) to generate a report for analysis

Note: These optional steps include the use of open source software hosted on GitHub.

PAL is a third-party tool that you can use to generate a report from your Performance Monitor file for a more in-depth analysis. To use PAL, follow these steps:

  1. Install PAL, launch the PAL Wizard, and then choose Next.
  2. For Performance Counter Log, enter the path to your Performance Monitor file, and then choose Next.
  3. For Title, choose System Overview, and then choose Next.
    Note: System Overview provides a general operating system performance analysis.
  4. Review and answer the questions for each entry in the Questions section. For OS, choose the latest Operating System version available from the list with a bit version that matches your instance. Choose Next.
  5. Select Process all of the counters in the counter log, and then choose Next.
    Note: Processing all counter instances can be resource intensive.
  6. For Output Folder, select an output directory for your PAL Report.
  7. For HTML Report, select HTML Report, and then choose Next.
  8. Choose Next, and then choose Finish.
  9. Review the Process and Processor sections of the PAL Report to determine which processes are using the instance's CPU.

Related information

How can I find out if the CPU on my T2 or T3 EC2 Windows instance is being throttled?

AWS OFFICIAL
AWS OFFICIALUpdated a year ago