Enable or disable performance counters
How to enable or disable storing of Sitecore performance counters in Windows Counters or in Azure Application Insights.
To help you analyze performance and troubleshoot issues, Sitecore stores many performance counters. The counters keep track of how many times an item was accessed, the number of operations against the database, the amount of messages sent to the log, and more.
For on-premise installations, performance counters are stored in Windows Counters. For cloud installations, counters are stored in Azure Application Insights.
Important
Storing counters in Azure is not free. By default, for on-premise and Azure deployments for both Core roles and XP Services roles, the performance counters are enabled.
To enable or disable counter storing for one or more roles, you must edit or rename the configuration files depending on the roles and the deployment.
Note
If you are deploying an XP Scaled (XP1) installation, you must repeat the configuration procedure for every role that you want to enable or disable performance counters for.
Before installation, you can configure performance counters for Core roles deployed on Azure. (You cannot configure performance counters for XP Services roles before installation.)
To configure performance counters for Core roles deployed on Azure:
Go to the
azuredeploy.json
file.To disable performance counters, set the
storeSitecoreCountersApplicationInsights
setting tofalse
."storeSitecoreCountersInApplicationInsights": { "type": "bool", "defaultValue": false }
If you want to enable performance counters again and return to the default configuration, set the storeSitecoreCountersApplicationInsights
setting to true
.
"storeSitecoreCountersInApplicationInsights": { "type": "bool", "defaultValue": true }
After installation, you can configure performance counters for Core roles deployed on-premise and on Azure.
Core roles deployed on-premise
To configure performance counters for Core roles deployed on-premise:
Go to the
\App_Config\Sitecore.config
file.To disable the creation of the performance counters file, set the
interval
setting to00:00:00
.<agent type="Sitecore.Tasks.CounterDumpAgent" method="Run" interval="00:00:00"> <DumpFile>$(dataFolder)/diagnostics/counters/counters.{date}.{time}.{processid}.txt</DumpFile> </agent>
To disable performance counters, set the
Counters.Enabled
setting tofalse
.<setting name="Counters.Enabled" value="false" />
If you want to enable performance counters again and return to the default configuration, set the interval
setting to 01:00:00
and the Counters.Enabled
setting to true
.
<agent type="Sitecore.Tasks.CounterDumpAgent" method="Run" interval="01:00:00"> <DumpFile>$(dataFolder)/diagnostics/counters/counters.{date}.{time}.{processid}.txt</DumpFile> </agent>
<setting name="Counters.Enabled" value="true" />
Core roles deployed on Azure
To configure performance counters for Core roles deployed on Azure:
Go to the
\App_Config\Sitecore.Cloud.ApplicationInsights.config
file.To disable performance counters, set the
Counters.Enabled
setting tofalse
.<setting name="Counters.Enabled" value="false" />
If you want to enable performance counters again and return to the default configuration, set the Counters.Enabled
setting to true
.
<setting name="Counters.Enabled" value="true" />
After installation, you can configure performance counters for XP Services roles deployed on-premise and on Azure.
XP Services roles deployed on-premise
To configure performance counters for XP Services roles deployed on-premise:
Go to the
\App_Data\Config\Sitecore\CoreServices\
folder.To disable performance counters, add a
.disabled
suffix to thesc.PerformanceCounters.WindowsSystem.xml
file and remove the.disabled
suffix from thesc.PerformanceCounters.DisableCounters.xml
file.Important
Removing the
.disabled
suffix from both files causes a critical initialization exception to occur, and Sitecore will not start unless you add the.disabled
suffix to one of the configuration files.You must repeat this procedure for all relevant roles.
If you want to enable performance counters again and return to the default configuration, remove the .disabled
suffix from the sc.PerformanceCounters.WindowsSystem.xml
file. and add a .disabled
suffix to the sc.PerformanceCounters.DisableCounters.xml
file.
XP Services roles deployed on Azure
To configure performance counters for XP Services roles deployed on Azure:
Go to the
\App_Data\Config\Sitecore\CoreServices\
folder.To disable performance counters, add a
.disabled
suffix to thesc.PerformanceCounters.AppInsights.xml
file and remove the.disabled
suffix from thesc.PerformanceCounters.DisableCounters.xml
file.Important
Removing the
.disabled
suffix from both files causes a critical initialization exception to occur, and Sitecore will not start unless you add the.disabled
suffix to one of the configuration files.You must repeat this procedure for all relevant roles.
If you want to enable performance counters again and return to the default configuration, remove the .disabled
suffix from the sc.PerformanceCounters.AppInsights.xml
file and add a .disabled
suffix to the sc.PerformanceCounters.DisableCounters.xml
file.