Sitecore SearchStax SOLR High CPU Usages
Problem Statement:
As part of the cloud infrastructure monitoring activities, the Sitecore Cloud Operations team identified an event and shared an email regarding the Sitecore Cloud Alert 'SearchStax CPU Usage.'
We received alerts indicating that high CPU usage was detected on all nodes of the Solr deployment. Upon further investigation, the following observations were made:
- High CPU usage and system load
- High indexing activities
Solution:
A CPU Usage alert is a Threshold Alert that notifies you via email when the CPU of your SearchStax Managed Search service deployment exceeds a specified threshold for a certain number of minutes. This triggers an Incident in the Managed Search Dashboard.
Here are some recommendations to enhance SearchStax performance and improvement:
1. ContentSearch.SearchMaxResults/Lowering &rows=1000000
This setting determines the number of search results the search provider is asked to retrieve.
By default, Sitecore sends /selects and /suggests queries to Solr with the &rows parameter set to 1,000,000, and in some cases, 100,000,000. These configurations put a significant load on Solr, often resulting in maximum CPU and JVM usage because Solr allocates enough memory to hold a million documents before processing each query. Since Sitecore can generate hundreds of such queries within seconds, the memory load may exceed Solr's capacity.
- SearchStax recommends reducing the default configuration as follows:
- Navigate to App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.config in your Sitecore installation.
- Locate <setting name="ContentSearch.SearchMaxResults" value="1000000" />.
- Change the value to "100" unless there is a specific need to retrieve more than a thousand documents. A typical scenario is that users search broadly but only browse the first one or two pages of results.
- Save the file and restart Sitecore.
2. MaximumCommitMilliseconds –
This setting specifies the number of milliseconds that can elapse before changes sent to Solr are committed and made searchable. You can address this by adjusting the setting.
In the event of a performance issue, you can increase the value of the MaximumCommitMilliseconds setting in the \App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexWriter.SOLR.xml file for the xConnect search service:
<MaximumCommitMilliseconds>2400000</MaximumCommitMilliseconds>
3. Interval-based Index Rebuild Strategy:
Master Database: This strategy uses an interval-based trigger and the EventQueue from the predefined 'master' database to incrementally rebuild the index.
You can change the interval setting, in \App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.DefaultConfigurations.config file for the master database to 20 min:
<param desc="interval">00:20:00</param>
Core Database: This strategy uses an interval-based trigger and the EventQueue from the predefined 'core' database to incrementally rebuild the index.
You can change the interval setting, \App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.DefaultConfigurations.Core.config file for the master database to10 min:
<param desc="interval">00:10:00</param>
Reference:
Happy Sitecoreing 😊
Comments
Post a Comment