Enable Sitecore Performance Counters - Aria-Akbariyeh/Docs GitHub Wiki

Sitecore has a built in feature that writes configured Performance counters in the log files. But performance messages may not show in the log files the first time you install Sitecore on your machine. To understand what is the issue, you can open Sitecore Logs files using SIM Log Analyzer Tool and check warnings about Performance counters. Sitecore generates a warning message about why it cannot access performance counters. You can then refer to the following article which describes common issues and their solutions: https://kb.sitecore.net/articles/404548

Here are some steps I took before being able to see performance counter entries in Sitecore logs:

(Step 1): Changed the IIS application pool identity of my application from "ApplicationPoolIdentity" to "Network Service" as ApplicationPoolIdentity creates a virtual user which does not have access to "performance monitor users" and "performance log users" groups.

(Step 2): Open "Computer management" > "Local Users and Groups" > "Groups" > and 'Add' the application pool user account (in my case: Network Service) to "Performance Monitor Uses" and "Performance Log Users" groups.

(Step 3): Reload performance counters:

  1. Start an administrator command prompt.
  2. Run "unlodctr .NETFramework"
  3. Run "lodctr %WINDIR%\INF.NETFramework\CORPerfMonSymbols.ini"
  4. Restart Server

(Step 4): Performance counters are logged by the Sitecore health monitor which is a background task that runs the “healthMonitor” pipeline with an interval specified by the “HealthMonitorInterval” setting. One of the processors of this pipeline logs counter values to log files. So Ensure HealthMonitorInterval is not set to 0.

  <setting name="HealthMonitorInterval" value="00:00:30" />

(Step 5): Ensure Siteore performance counters feature is enabled:

<setting name="Counters.Enabled" value="true" />

(Step 6): Use Log Analyzer Health Monitor tab to check peformance counters. Health Monitor tab filters below sitecore log messages:

ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp#1, Process\Virtual Bytes): 2,220,404,473,856 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp#1, Process\Page File Bytes): 766,078,976 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp, .NET CLR Memory\# Bytes in all Heaps): 89,103,568 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp, .NET CLR Memory\% Time in GC): 0.33 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp, .NET CLR Memory\Large Object Heap size): 28,875,464 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp, .NET CLR Loading\Bytes in Loader Heap): 83,374,080 
ManagedPoolThread #2 2020-01-01 15:34:27 INFO Health.Counter(w3wp, .NET CLR Loading\Current Assemblies): 488