Redis connection pooling configuration


Overview of the Redis connection pool settings for Commerce Engine caching and Commerce Engine Connect caching.

Sitecore Experience Commerce (XC) supports Redis connection pooling. Database connection pooling can help improve Commerce Engine or Commerce Engine Connect performance when responding to a high volume of complex requests for cached data.

With Sitecore XC, when the Redis connection pool manager selects a connection from a pool, it uses the least loaded connection, based on the StackExchange.Redis.ServerCounters.TotalOutstanding property. The use of multiple connections in a pool helps prevent scenarios where a request timeout in a single connection causes other queued requests to also timeout.

For Commerce Engine caching, Redis cache provider settings are located in the Commerce Engine config.json file.

For Commerce Engine Connect caching, the CE Connect cache settings are located in the c:\inetpub\wwwroot\<site>\App_Config\Include\Y.Commerce.Engine folder, in the Sitecore.Commerce.Engine.Connect.config file.

To configure connection pooling, you specify the number of connections allowed in a pool using the redisConnectionPoolSize property. The default configuration is:

"redisConnectionPoolSize": 1

Determining the connection pool size value for your deployment

To determine the appropriate Redis connection pool size setting for your deployment, it is good practice to start with a value that corresponds to the count of CPU cores available, multiplied by the count of HT (if using Intel Hyper-Threading Technology) or SMT (simultaneous multithreading, for processors other than Intel).

For example:

4 (CPU cores) x 2 (HT/SMT) = 8, where 8 is the initial value for the RedisConnectionPoolSize setting.