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.