Configure processing agents
When you configure a xDB Processing server, to optimize performance, you may need to change the number of aggregation agents or threads that you run. Aggregation agents pick up interactions to be processed by the aggregation pipeline and convert data into a form suitable for use by the reporting database.
To configure aggregation agents or threads on a processing server:
-
Open the
Sitecore.Analytics.Processing.Aggregation.Services.config
file in an XML editor. You can specify how many aggregation agents you want to run at the same time. Start by using the default settings. -
Edit the
maxAgents
setting to specify the number of aggregation agents that you want to run on the server. You can also specify how many cleanup and recovery threads that you need. Adjust these settings depending on your available hardware and business requirements. Use the default values and then, over time, adjust these settings to optimize your aggregation server or servers.RequestResponse<module type="Sitecore.Analytics.Aggregation.AggregationModule" singleInstance="true"> <BackgroundServices hint="list:Add"> <aggregator type="Sitecore.Analytics.Core.AsyncBackgroundService"> <param resolve="true" type="Sitecore.Abstractions.BaseLog, Sitecore.Kernel" /> <param desc="agentPath">aggregation/aggregator</param> <param desc="interval" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToTimeSpan" arg0="0.00:00:15" /> <param desc="maxAgents" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToInt" arg0="1" /> </aggregator> <contactProcessing type="Sitecore.Analytics.Core.AsyncBackgroundService"> <param resolve="true" type="Sitecore.Abstractions.BaseLog, Sitecore.Kernel" /> <param desc="agentPath">aggregation/contactProcessing</param> <param desc="interval" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToTimeSpan" arg0="0.00:00:15" /> <param desc="maxAgents" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToInt" arg0="1" /> </contactProcessing> <rebuild type="Sitecore.Analytics.Core.AsyncBackgroundService"> <param resolve="true" type="Sitecore.Abstractions.BaseLog, Sitecore.Kernel" /> <param desc="agentPath">aggregation/rebuildAgent</param> <param desc="interval" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToTimeSpan" arg0="0.00:00:15" /> <param desc="maxAgents" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToInt" arg0="1" /> </rebuild> <history type="Sitecore.Analytics.Core.AsyncBackgroundService"> <param resolve="true" type="Sitecore.Abstractions.BaseLog, Sitecore.Kernel" /> <param desc="agentPath">aggregation/historyWorker</param> <param desc="interval" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToTimeSpan" arg0="0.00:00:15" /> <param desc="maxAgents" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToInt" arg0="1" /> </history> <historyCompletionCheck type="Sitecore.Analytics.Core.AsyncBackgroundService"> <param resolve="true" type="Sitecore.Abstractions.BaseLog, Sitecore.Kernel" /> <param desc="agentPath">aggregation/historyCompletionCheck</param> <param desc="interval" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToTimeSpan" arg0="0.00:00:15" /> <param desc="maxAgents" type="Sitecore.Analytics.Core.ConfigurationHelper, Sitecore.Analytics.Core" factoryMethod="ToInt" arg0="1" /> </historyCompletionCheck> </BackgroundServices> </module>
-
Adjust the
Max Pool Size
property for the reporting database. The pool capacity should be at least about 120% of the number of agents (including processing, history, automation workers, and clean-up) that you have configured. This setting ensures that each thread has its own dedicated connection and will not have to wait for another thread to release its connection before running. -
To set the pool size, open the reporting database connection string configuration file, add the
Max Pool Size
property, and set an appropriate value.
The following table describes the purpose of each agent:
Agent |
Description |
---|---|
aggregation/aggregator |
Processes interactions during live aggregation. The more threads used, the faster data about new interactions will appear in the reporting database. If there is little traffic on the website and few new interactions you can allocate fewer threads. |
aggregation/contactProcessing |
Processes contacts. It is very similar to the aggregator, except it executes contacts pipeline for new contacts. |
aggregation/rebuildAgent |
Executes the steps needed for rebuilding the reporting database. Do not allocate more than 1 thread for it. |
aggregation/historyWorker |
Main actor in a History rebuild. Allocate the maximum number of threads you can before a rebuild. When the rebuild finishes, you can set it back to one because this agent is only active during a History rebuild. |
aggregation/historyCompletionCheck |
Checks if all history worker agents have finished processing interactions. When they have, it marks the History Rebuild process as completed. One agent is enough. |