Enable or disable performance counters
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.
Storing counters in Azure is not free. By default, the performance counters are disabled in on-premise and Azure deployments, for both Core roles and XP Services roles.
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.
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 on.
Configure performance counters for both Core and XP Services roles before installation
Before installation, you can configure performance counters for Core and XP Services roles deployed on Azure.
To configure performance counters for Core and XP Services roles deployed on Azure:
-
Go to the
azuredeploy.json
file. -
To enable performance counters, set the
storeSitecoreCountersApplicationInsights
setting totrue
.RequestResponse"storeSitecoreCountersInApplicationInsights": { "type": "bool", "defaultValue": true }
If you want to disable performance counters again and return to the default configuration, set the storeSitecoreCountersApplicationInsights
setting to false
.
"storeSitecoreCountersInApplicationInsights": {
"type": "bool",
"defaultValue": false
}
Configure performance counters only for XP Services roles before installation
Before installation, you can configure performance counters for XP Services roles deployed on Azure separately from Core roles.
To configure performance counters for XP Services roles deployed on Azure separately from Core roles:
-
Go to the
azuredeploy.json
file. -
To enable performance counters, set the
xpPerformanceCountersType
setting toApplicationInsights
.RequestResponse"xpPerformanceCountersType": { "value": "ApplicationInsights" }
If you want to disable performance counters again and return to the default configuration, set the xpPerformanceCOuntersType
setting to Disable
.
"xpPerformanceCountersType": {
"value": "Disable"
}
Configure performance counters for Core roles after installation
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 enable the creation of the performance counters file, set the
interval
setting to01:00:00
.RequestResponse<agent type="Sitecore.Tasks.CounterDumpAgent" method="Run" interval="01:00:00"> <DumpFile>$(dataFolder)/diagnostics/counters/counters.{date}.{time}.{processid}.txt</DumpFile> </agent>
-
To enable performance counters, set the
Counters.Enabled
setting totrue
.RequestResponse<setting name="Counters.Enabled" value="true" />
If you want to disable performance counters again and return to the default configuration, set the interval
setting to 00:00:00
and the Counters.Enabled
setting to false
.
<agent type="Sitecore.Tasks.CounterDumpAgent" method="Run" interval="00:00:00">
<DumpFile>$(dataFolder)/diagnostics/counters/counters.{date}.{time}.{processid}.txt</DumpFile>
</agent>
<setting name="Counters.Enabled" value="false" />
Core roles deployed on Azure
To configure performance counters for Core roles deployed on-premise:
-
Go to the
\App_Config\Sitecore.Cloud.ApplicationInsights.config
file. -
To enable the performance counters, set the
Counters.Enabled
setting totrue
.RequestResponse<setting name="Counters.Enabled" value="true" />
If you want to disable performance counters again and return to the default configuration, set the Counters.Enabled
setting to false
.
<setting name="Counters.Enabled" value="false" />
Configure performance counters for XP Services roles after installation
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\sc.PerformanceCounters.Initialize.xml
file. -
To enable performance counters, set the
PerformanceCounters
setting toWindows
.RequestResponse<Settings> <Sitecore> <XConnect> <Initialize> <PerformanceCounters>Sitecore:XConnect:Diagnostics:PerformanceCounters:Windows</PerformanceCounters> </Initialize> </XConnect> </Sitecore> </Settings>
-
You must repeat this enable or disable procedure for all relevant roles.
If you want to disable performance counters again and return to the default configuration, set the PerformanceCounters
setting to Disable
.
<Settings>
<Sitecore>
<XConnect>
<Initialize
<PerformanceCounters>Sitecore:XConnect:Diagnostics:PerformanceCounters:Disable</PerformanceCounters>
</Initialize>
</XConnect>
</Sitecore>
</Settings>
XP Services roles deployed on Azure
To configure performance counters for XP Services roles deployed on Azure:
-
Ensure that Application Insights are enabled in Azure.
-
Go to the
\App_Data\Config\Sitecore\CoreServices\sc.PerformanceCounters.Initialize.xml
file. -
To enable performance counters, set the
PerformanceCounters
setting toApplicationInsights
.RequestResponse<Settings> <Sitecore> <XConnect> <Initialize> <PerformanceCounters>Sitecore:XConnect:Diagnostics:PerformanceCounters:ApplicationInsights</PerformanceCounters> </Initialize> </XConnect> </Sitecore> </Settings>
-
You must repeat this procedure for all relevant roles.
If you want to disable performance counters again and return to the default configuration, set the PerformanceCounters
setting to Disable
for all relevant roles.
<Settings>
<Sitecore>
<XConnect>
<Initialize
<PerformanceCounters>Sitecore:XConnect:Diagnostics:PerformanceCounters:Disable</PerformanceCounters>
</Initialize>
</XConnect>
</Sitecore>
</Settings>