allBlogsList

Simple Performance Tuning and Sitecore Counters Sitecore Best Practices

The official Sitecore CMS Performance Tuning Guide (requires SDN access: v6.5, 7.0) has stated (since the dawn of time – or at least every version I’ve ever read) that the Memory Monitoring hook should be disabled (and only enable it when troubleshooting Memory related issues):

<hooks>
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel"/>
<!--<hook type="Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Kernel">
<param desc="Threshold">800MB</param>
<param desc="Check interval">00:00:05</param>
<param desc="Minimum time between log entries">00:01:00</param>
<ClearCaches>false</ClearCaches>
<GarbageCollect>false</GarbageCollect>
<AdjustLoadFactor>false</AdjustLoadFactor>
</hook>-->
</hooks>

It also says that the Sitecore Performance Counters should be disabled because, as with any monitoring, it does come with some overhead and should only be enabled when in troubleshooting mode. This is as a minimum for production servers. But, these should really be for any server, as there is nothing worse than having to wait longer for your dev server to come back up after a rebuild/republish. Wait until you need them, but know they are there. To disable them, simply set this setting to false:

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

That said, I also believe it should be a best practice to at least run the Performance Counters enabled one time to make sure everything is installed and ready to run This is helpful in the event that you do end up needing them.

It just drives me nuts to see a log file filing up with any of these errors in them:

41160 12:45:01 WARN Sitecore has no necessary permissions for reading/creating counters.
41160 12:45:01 WARN Sitecore has no necessary permissions for reading/creating counters.
41160 12:45:01 WARN Sitecore has no necessary permissions for reading/creating counters.
41160 12:45:01 WARN Sitecore has no necessary permissions for reading/creating counters.
41160 12:45:01 WARN Sitecore has no necessary permissions for reading/creating counters.

If you see these, you need to add the account your AppPool is running under to the “Performance Monitor Users” group.

Or this:

25408 08:12:52 WARN Counter category 'Sitecore.System' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.System' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:52 WARN Counter category 'Sitecore.Caching' does not exist on this server.
25408 08:12:53 WARN Counter category 'Sitecore.Data' does not exist on this server.
25408 08:12:53 WARN Counter category 'Sitecore.Data' does not exist on this server.
25408 08:12:53 WARN Counter category 'Sitecore.Data' does not exist on this server.
25408 08:12:53 WARN Counter category 'Sitecore.Data' does not exist on this server.
25408 08:12:53 WARN Counter category 'Sitecore.Data' does not exist on this server.
25408 08:12:54 WARN Counter category 'Sitecore.Security' does not exist on this server.
25408 08:12:54 WARN Counter category 'Sitecore.Security' does not exist on this server.
25408 08:12:54 WARN Counter category 'Sitecore.Security' does not exist on this server.
25408 08:12:54 WARN Counter category 'Sitecore.Security' does not exist on this server.

If you see these, you need to install the Sitecore Counters. Just remember on newer versions of Windows that have UAC, you will need to right-click and “Run as Administrator” when installing the counters.

Or this:

41884 12:55:05 WARN Cannot resolve Instance name for the counter. Category: *, Counter name: *

You need to add the instance attribute to every node in the HealthMonitor pipeline – instance=”w3wp” (or “aspnet_wp” for WindowsXP).

For two primary reasons:
1. These are common easy fixes and there is a performance hit from having them enabled at all.
2. Errors are very expensive. Plus they fill up your log files making it more difficult to analyze without better tools like Log File Analyzer.

Don’t forget to turn off WebDAV if you’re not using it (most of the time on a dev server). Use the setting below or rename the file *.disabled):

<setting name="WebDAV.Enabled" value="false" />

For Sitecore v7 and newer, it is recommended you turn off Bucket Debug unless you need it:

<setting name="BucketConfiguration.EnableBucketDebug" value="false" />

Checking your log file for errors and fixing them is much like going to the doctor for a wellness check-up. Early detection and resolution is always best. Be sure to save a virtual tree and ensure your log files aren’t spewing garbage. It is like having a high performance engine, but running it on regular old unleaded fuel. Don’t do it. Use the high octane, unless you’re driving a Pinto.

Since these are the Sitecore recommended Best Practices, maybe we can get Sitecore to disable these by default.

Update 10/31/2014: Tricks & Treats! Happy Halloween! You can now download a simple config file: Sitecore.SharedSource.PerformanceTuning.config that turns off Counters, MemoryMonitorHook, WebDAV and BucketConfiguration.EnableBucketDebug.