How can I monitor CPU usage and processes on Windows Server 2012 as a service over a 24 hour period?

Solution 1:

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).

Solution 2:

Using Daniel K's suggestion of performance monitor, I found out how to do this.

  • Load up Performance Monitor
  • Go to 'Data Collector Sets'
  • Expand 'User Defined'
  • Make a new 'Data Set'
  • Select Create Manually (Advanced), note you can't change the name without deleting so make it sensible now
  • Press next, choose 'Create data logs' and 'Performance counter'
  • Press next, press Add.
  • Top left, expand 'Process', click '% Processor Time' and anything else you might want.
  • Bottom left, click ''
  • Click the 'Add >>' button and press OK
  • Select a suitable sample interval, and continue pressing Next until you reach the end of the wizard.
  • You can start collecting by right clicking the data collector set and pressing Start, or going to properties on it and setting up scheduling. I found that my data collector stopped working after like 30 minutes without putting a stop condition, but that may have been an anomaly.
  • Once your data collection is done, expand Reports > User Defined > Your Data Set
  • Double click to open it.
  • Notice at the bottom it says '% Processor Time' and instance is '_Total'. By default, it's showing you the total CPU usage. This includes 'Idle Time' so it will always bee around 100%.
  • Click the green + button on the top bar just above the graph (not in the top window)
  • Click 'Process' top left, and in the bottom you can choose individual processes to view, or select '' and press Add.
  • Click OK, and you should see a detailed graph with CPU usage per process.