Sitecore Prefetch Cache Size Different after upgradation

北城余情 提交于 2020-01-06 06:26:34

问题


I have done the Sitecore upgrading from 8.1 to 9.0 Update 2. I see there is an issue on the prefetch cache.

On the old version the webdb prefetch cache will go till 6GB but on the upgraded version it is not crossing 1.5GB.

Sitecore 8.1 Instance

Sitecore 9.0 Upgraded Instance


回答1:


There was a huge investment in caching architecture redesign, I'll bring up a few things that were changed:

1) Game changer - Sitecore.Interning.config that allows reusing repeatable immutable objects (like strings, IDs) - we keep much less duplicate objects in memory now out of the box. You could see the difference by disabling interning in the aforementioned config.

2) Introduce Sitecore.Caching.Interfaces.ISizeTrackable interface that should help entities know their size better - that is very true for PreferechData; it will even give you different sizes for 32/64 bit app pool setting (as pointer size is different).

3) Introduce Sitecore.Common.ITrimExcess interface that allows a collection to shrink upon a major portion of data is added (internally relies on TrimExcess() APIs for List or HashList).

To sum up - much lower numbers are expected for core platform parts as those were carefully crafted :)




回答2:


Have you compared how much memory the w3wp process actually consumes? It looks like you have a similar amount of items in the cache. From what I can see in your screen shots, the cache is working as expected in both scenarios.

The cache size of each object is estimated through the ICacheable.GetDataLength() implementation of each cacheable object. This value isn't always accurate and sometimes it's actually quite far off. At least in previous versions of Sitecore, you could do a sum of the entire cache size column and get a total sum that's far greater than your w3wp process size.

If I recall right, Sitecore has changed how object sizes are estimated by default. You're probably seeing an effect of that.



来源:https://stackoverflow.com/questions/56111546/sitecore-prefetch-cache-size-different-after-upgradation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!