I have written a windows based webserver service which uses Sql Server Express as the back-end database. Every couple days CPU will spike to 100%. Inspection of my webserver logs reveal my service was having problems making queries to the Sql Server database . When I examine Task Manager, both my service and Sql Server are using the majority of the CPU. I am unsure if the problem is my service or Sql Server.

I was hoping to use PerfMon or some other utility to keep a log of CPU usage by process (or filter specifically my service and Sql Server). This way when my server enters this state I can go back, inspect these logs, and determine if it was my service or Sql Server which initially caused the CPU spike.

Is this possible?

This article indicates PerfMon cannot be used to track metrics for a specific service.

  • have you tried WPR/WPA? Commented Apr 5, 2016 at 4:07

1 Answer 1


To analyze the CPU usage on modern Windows systems (NT6.x - Vista or newer), you can use the Windows Performance Toolkit.

Install the WPT, which is part of the Windows 10 SDK (make sure you use the TH2 Version of the SDK if you capture a trace on Win7/8, the TH1 version from July is broken).

"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -start CPU -start DotNET && timeout -1 && "C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -stop Result.etl

Now open the result.etl in Windows Performance Analyzer (WPA.exe) and analyze the CPU usage

enter image description here

Here the CPU usage comes from simply starting Reflector.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .