Sitecore Performance Optimization Configuration

When configuring a Sitecore instance for a production environment, performance optimization is critical to ensure smooth operation under heavy traffic and usage. As a Sitecore developer, I often configure the settings below to enhance performance, particularly for high-demand sites. These settings are designed to manage memory usage, reduce unnecessary resource consumption, and fine-tune how Sitecore handles tasks like caching, analytics, and content management. By adjusting cache sizes, disabling certain features, and refining other key configurations, we can ensure that Sitecore performs efficiently while balancing resource utilization.

This configuration can be utilized to improve the performance of Sitecore across various environments, ensuring that production instances are set up to deliver optimal results.

1<?xml version="1.0"?>
2<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:env="http://www.sitecore.net/xmlconfig/env/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
3    <sitecore>
4
5        <databases>
6            <database id="web" role:require="ContentDelivery or Standalone">
7                <securityEnabled>false</securityEnabled>
8                <cacheSizes>
9                    <data>1000MB</data>
10                    <items>1000MB</items>
11                </cacheSizes>
12            </database>
13
14            <database id="master" role:require="Standalone or ContentManagement">
15                <cacheSizes>
16                    <data>1000MB</data>
17                    <items>1000MB</items>
18                </cacheSizes>
19            </database>
20        </databases>
21        
22        <settings>
23            <setting name="Analytics.AutoDetectBots" value="true" />
24            <setting name="Analytics.Robots.IgnoreRobots" value="true" />
25            <setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false" />
26            <setting name="Publishing.DeepScanRelatedItems" value="false"/>
27            <setting name="Caching.AccessResultCacheSize" value="200MB" />
28            <setting name="Counters.Enabled" set:value="false" />
29            <setting name="ContentEditor.CheckHasChildrenOnTreeNodes" set:value="false" />
30            <setting name="ContentEditor.CheckSecurityOnTreeNodes" set:value="false" />
31            <setting name="Pipelines.Profiling.Enabled" set:value="false" />
32            <setting name="Analytics.CookieLifetime" set:value="34310"/>
33
34            <setting name="HtmlEditor.RemoveScripts" >
35                <patch:attribute name="value">false</patch:attribute>
36            </setting>
37
38            <setting name="GeoIp.PerformLookup">
39                <patch:attribute name="value" value="false" />
40            </setting>
41        </settings>
42        
43        <scheduling>
44            <agent type="Sitecore.Tasks.CounterDumpAgent">
45                <patch:delete />
46            </agent>
47            <frequency>02:00:00</frequency>
48        </scheduling>
49        
50        <hooks>
51            <hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
52                <patch:delete />
53            </hook>
54            <hook type="Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Kernel">
55                <patch:delete />
56            </hook>
57        </hooks>
58        
59    </sitecore>
60</configuration>

Configuration Breakdown

Database Settings

  • <securityEnabled>false</securityEnabled> in <database id="web">
    Disables security checks on the web database, which can improve performance by bypassing permission evaluations for public content.

    • Pros: Increases speed for content retrieval.
    • Cons: May pose a risk if sensitive content is mistakenly published.
  • <cacheSizes> in <database id="web"> and <database id="master">
    Sets cache sizes for data and items on both databases, optimizing retrieval times.

    • Pros: Enhances performance by reducing database calls.
    • Cons: High memory usage may require monitoring to avoid memory issues.

Sitecore Settings

  • <setting name="Analytics.AutoDetectBots" value="true" />
    Enables bot detection, filtering bot activity in analytics.

    • Pros: Improves analytics accuracy.
    • Cons: Could misclassify some legitimate users as bots.
  • <setting name="Analytics.Robots.IgnoreRobots" value="true" />
    Ignores bot activity in analytics reports.

    • Pros: Maintains data integrity by excluding bots.
    • Cons: Risk of overlooking user behavior if real users are misclassified as bots.
  • <setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false" />
    Disables automatic content testing.

    • Pros: Reduces resource use by disabling unused features.
    • Cons: Limits A/B testing capabilities.
  • <setting name="Publishing.DeepScanRelatedItems" value="false"/>
    Prevents deep scans of related items during publishing, which can enhance publish speed.

    • Pros: Shortens publishing times.
    • Cons: Potentially omits related items if dependencies exist.
  • <setting name="Caching.AccessResultCacheSize" value="200MB" />
    Allocates 200MB to the access result cache, helping cache permission checks.

    • Pros: Speeds up access calculations.
    • Cons: Higher memory use.
  • <setting name="Counters.Enabled" set:value="false" />
    Disables Sitecore counters, which track various metrics.

    • Pros: Frees up resources, optimizing performance.
    • Cons: Reduces ability to monitor performance metrics.
  • <setting name="ContentEditor.CheckHasChildrenOnTreeNodes" set:value="false" />
    Disables child node checks in the Content Editor, reducing rendering time.

    • Pros: Speeds up Content Editor operations.
    • Cons: Tree view may lack structure information, which could impact navigation.
  • <setting name="ContentEditor.CheckSecurityOnTreeNodes" set:value="false" />
    Disables security checks on tree nodes in Content Editor.

    • Pros: Enhances performance for content editors.
    • Cons: Security risks if sensitive content permissions are ignored.
  • <setting name="Pipelines.Profiling.Enabled" set:value="false" />
    Disables pipeline profiling, saving resources by not tracking processing performance.

    • Pros: Improves response time and reduces load.
    • Cons: Limited visibility for pipeline-related debugging.
  • <setting name="Analytics.CookieLifetime" set:value="34310"/>
    Sets the duration for analytics cookies.

    • Pros: Manages user session persistence.
    • Cons: Shorter cookie lifetimes may impact tracking consistency.
  • <setting name="HtmlEditor.RemoveScripts"><patch:attribute name="value">false</patch:attribute></setting>
    Allows scripts to be included in HTML editor content.

    • Pros: Supports custom scripting in content.
    • Cons: Potential security risks if scripts are not sanitized.
  • <setting name="GeoIp.PerformLookup"><patch:attribute name="value" value="false" /></setting>
    Disables GeoIP lookup, which can reduce load from location-based lookups.

    • Pros: Enhances performance by avoiding extra lookups.
    • Cons: Location-based content may be impacted if needed.

Scheduling

  • Counter Dump Agent Deletion
    <agent type="Sitecore.Tasks.CounterDumpAgent"><patch:delete /></agent>
    Removes the CounterDumpAgent to reduce processing overhead.
    • Pros: Reduces load by eliminating non-essential monitoring.
    • Cons: Reduces insight into counters.

Hooks

  • Health Monitor Hook Deletion
    <hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel"><patch:delete /></hook>
    Removes Health Monitor Hook, saving resources.

    • Pros: Reduces resource consumption.
    • Cons: Misses out on automated health monitoring.
  • Memory Monitor Hook Deletion
    <hook type="Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Kernel"><patch:delete /></hook>
    Disables Memory Monitor Hook to avoid memory monitoring overhead.

    • Pros: Saves resources.
    • Cons: Undetected memory issues could affect performance.

Ensure to thoroughly test configurations before production deployment, especially if disabling features essential for monitoring or analytics.

Related Posts

Exposing Site Settings from the Settings item in a Headless JSS Next.js Application

In this blog post, we will explore a common requirement in Sitecore Headless SXA, exposing site-specific settings and global data to the front end when working with a JSS headless site. ## Problem S

Read More

Handling Sitecore CM and IdentityServer Behind a Proxy or CDN in an Azure Environment

Recently, while working with a Sitecore 10.4 deployment in an Azure environment, we encountered an interesting challenge: handling Sitecore Content Management (CM) and IdentityServer (SI) behind a pr

Read More

Leveraging Sitecore Search SDK Starter Kit into Your Sitecore Next.js Solution [Part 2]

In this blog post, I'll walk you through the process of smoothly leveraging the Search SDK Starter Kit into a Sitecore Next.js solution. ## Prerequisites Before proceeding, ensure the following prer

Read More