Estimate memory and storage requirements for session state

To plan your content delivery server and session state database server deployments, you must estimate your memory and disk space capacity requirements for your session state store.

Depending on your server configuration, your session state store can use memory or a physical session database before saving session data to the xDB at the end of each web session.

When estimating your storage requirements for a session state store, consider the following:

  • Private session state size - typically, a clean Sitecore installation needs approximately 30 kb of storage capacity per session.

  • Shared session state size - space requirements depend on the number of contacts you have in xDB and how many customizations you have implemented. For example, you need more space if you have custom contact facets populated with data or if you want to load a contact's visit history for personalization. To estimate the number of contacts, you can query the database where your contacts are stored.   

  • Session duration - in xDB, you can analyze interactions to find out the average duration of web sessions on your website. Shared sessions tend to be longer than private sessions because multiple visits from the same contact overlap in the shared session state object. For a typical website, the number of concurrent shared sessions is equal to or slightly less than the number of concurrent private sessions.

To calculate your storage requirements, use this formula:

  • Requests per second/average page views per session * (session duration in seconds + session end overhead) * estimated session size.



Requests per second

The average number of HTTP requests that the website serves every second. You can get this value from the ASP.NET performance counters.

Average page views per session

The number of HTTP requests that makes up an average website session. You can get this information from the xDB.

Session duration in seconds

The amount of time that the session is present in the session database. This calculation is based on:

  • How long the visitor is active on the website – the difference between the StartDateTime and EndDateTime in the interaction record.

  • Session timeout – the session timeout value defined in your ASP.NET configuration.

  • Session end overhead – approximately one minute.

Session end overhead

The average time it takes for Sitecore to process an expired session and to remove it from the session state store. This value is calculated in seconds and does not typically exceed one minute.

Example of calculation

To calculate the storage requirements for the following website requirements:

  • Session timeout: 20 minutes

  • Session end overhead: approx.1 minute

  • Average session: 7 page views

  • Average visit: 5 minutes

  • Registered traffic: 10 requests per second

Estimated storage requirement calculation:

  • 10 RPS / 7 * (5 + 20 + 1) * 60 * 30k = approximately 64MB.