Tune cache values

Abstract

Procedure for tuning cache values of the Sitecore Content Delivery core role and other core roles.

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 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

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 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.

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

6. Repeat the previous step until the caches are stable. A cache is considered stable when:

• The cache size is between 70% and 80%.

• The Delta value remains relatively consistent.