Configure session expiration

Current version: 10.2

The Content Delivery role submits expired sessions to xConnect. You can tune session expiration settings or dedicate a Content Delivery instance to session expiration to improve the performance of the Content Delivery environment.

The session expiration process

The following diagram shows the roles and steps involved in processing expired sessions:

The Content Delivery role:

  1. Checks session state provider (in this example, a SQL database) for expired sessions at configurable intervals.

  2. Adds expired sessions to an in-memory processing queue.

  3. Converts expired sessions from the tracker model to the xConnect model and submits to the xConnect Collection (Search) service.

The maxConcurrencyLevel and SessionExpirationThreadCount settings limit the number of simultaneous threads available to handle session expiration. These settings allow you to throttle session expiration in a system under load and ensures that the Content Delivery environment remains responsive.

Performance tuning measures

If the size of the session storage role is constantly growing, consider the following:

  • Increase the number of simultaneous threads available to handle by increasing the maxConcurrencyLevel and SessionExpirationThreadCount settings. You must balance changes to these settings against the overall performance of your Content Delivery environment.

  • Introduce one or more instances of the Content Delivery role to exclusively handle session expiration.

If the tracker consistently reports timeout exceptions when attempting to write data to the xConnect Collection service, you should first review the performance of the xConnect Collection service. You can also increase the pollingExpirationTimeout setting to allow the tracker more time to submit data.

Key configuration settings

The following tables describe settings that are key to tuning the performance of session expiration. Refer to the web.config and App_Config\Sitcore.config file for a complete list of settings.

The following table describes settings available session state provider element in the web.config file:

Attribute

Description

Default value

maxConcurrencyLevel

Determines how many threads that run simultaneously to add expired sessions to the in-memory queue.

A default value is used if the attribute is not present.

SessionExpirationThreadCount multiplied by SessionExpirationBatchSize multiplied by 2.

Note

For a description of the SessionExpirationBatchSize setting, please refer to the Configure session end batching topic.

pollingExpirationTimeout

Determines the time (in seconds) that an expired session can be locked for processing.

120 seconds

The following table describes settings available in the App_Config\Sitecore.config file. We recommend that you create a patch file to update this setting.

Setting

Description

Default value

SessionExpirationThreadCount

Determines how many threads run simultaneously to process expired sessions in the queue and submit them to xConnect.

A default value is used if the attribute is not present.

Number of processor cores.

For example, if you have 8 cores, 8 threads are used.

Do you have some feedback for us?

If you have suggestions for improving this article,