Windows Server Monitoring – How to Monitor CPU Usage and Processes on Windows Server 2012

cpu-usagewindows-server-2008-r2

We have a long running performant operation that runs for 6 hours. When it was last ran, something happened for 5 minutes where its performance dropped dramatically and caused a few timeouts, in the middle of the night. I suspect some other process kicked in and hammered the CPU or similar.

The suggestion on this site from searching around is to use ProcessMonitor to monitor CPU. However, it only seems to capture traffic while it's running, and it is a desktop app. My windows server instance kicks you off after being idle for 10 minutes, controlled by group policy and I can't change it, so I can't use desktop apps for monitoring.

I need to monitor CPU usage over a 24 hour period. I am only interested in, process name, and cpu usage (%) so I can find out what, if anything, is kicking in and ruining things.

Because you get kicked off I really need something that can run as a windows service.

Is there any way to do this (using ProcessMonitor or similar tool – surely windows server has something built in?) as a service so I don't need to be logged into remote desktop, or am I going to have to find some kind of mouse moving script and leave my computer on all night?

Edit:

Performance Monitor looks promising. It is hard to find out how to configure it to give me what I want.

I made a custom data collector cpu and process ID:

enter image description here

What I want to do is able to see the CPU usage of each process at a particular time, like you can do in Task Manager except with a graph and ability to view a snapshot at any point during the monitoring period.

So I can see a graph of 24 hours, see the point where there's a spike, click it, and see which process is causing it.

I am not even convinced that my above configuration if I get it working will tell me the process name either, it says process ID, if that turns out to be a guid or similar that's likely no help either, especially if the process starts and stops and isn't still running when I go to investigate.

Best Answer

Windows Server has a built-in tool to show performance data in real time or to collect data in logs for later review. I think that this will do exactly what you are looking for.

screenshot of Performance Monitor

See this article for a basic tutorial on using Performance Monitor for logging on Windows Server 2012 R2.

See this excellent article on all the tools available to you for examining performance on Windows (mostly interactive tools).