0

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.

0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.