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

Last updated: 2019-05-17

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 needed, you can also use Performance Monitor or Process Explorer to deep dive 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 if 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 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're still unable to determine the cause of the high CPU utilization, use Performance Monitor and the Performance Analysis of Logs (PAL) tool. 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 you are currently seeing the CPU spike, you can instead 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.

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

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 of the 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.

Did this article help you?

Anything we could improve?


Need more help?