Tune cache values

Version: 10.3

Applies to

All Core roles, but particularly Content Delivery

A Sitecore cache consumes memory based on the amount of data stored in the cache. Cache size defines the maximum application memory the cache can consume. The following instructions apply to all Sitecore caches.

To tune cache values:

  1. Ensure that you have set initial cache values before tuning.

  2. Choose a load testing tool (Gatling and JMeter are free).

  3. Start a load test that hits all items in all languages. The load test must run for the duration of the cache tuning exercise.

    • If you are tuning caches for Content Delivery, use your load test to simulate visits to the published site.

    • If you are tuning caches for Content Management, use your load test to simulate visits to the Experience Editor and Content Editor. Ideally, your test should including expanding the Content Tree.

  4. While the load test is running, browse to the /sitecore/admin/cache.aspx page. While tuning the Content Delivery environment, pay particular attention to the following caches:

    • web[data] (Data cache)

    • web[item] (Item cache)

    • SqlDataProvider- Prefetch data(web) (Prefetch cache)

    When tuning the Content Management environment, pay particular attention to the following caches :

    • master[data] (Data cache)

    • master[item] (Item cache)

    • SqlDataProvider- Prefetch data(master) (Prefetch cache)

  5. To see how caches to react to load, on the /sitecore/admin/cache.aspx, click Refresh.

    Note

    On a Content Delivery server, access to the administrative pages is normally not available. Sitecore saves of copy of the cache.aspx page every ten minutes in the App_Data\diagnostics\health_monitor folder with names such as CacheStatus.20200907Z.131237Z.html where 20200907Z.131237Z is a time stamp. You can use these snapshots instead.

    Note

    The maximum amount of memory that you can assign to caches depends on the amount of memory available in the system.

    • If the size of the cache is consistently more than 80% of the maximum cache size, increase the size of the cache by 25%.

    • If the size of the cache remains less than 50% of the MaxSize, decrease the size of the cache by 25%.

    • If the cache Delta fluctuates significantly, increase the size of the cache by 25%.

      Note

      Significant fluctuations in the cache delta indicates that the cache is regularly exceeding max size and being scavenged. A cache is scavenged by half (half of the cache entries are removed) when it exceeds maximum.

  6. Repeat the previous step until the caches are stable. A cache is considered stable when the Delta value remains relatively consistent.

Do you have some feedback for us?

If you have suggestions for improving this article,