Question

We are using Glass Mapper models with Sitecore 7.1 (MVC Renderings), we recently deployed this project to live environment, but our client noticed that performance is degrading over time, for example, after 8~12 hours, some pages start to take 20 seconds to load. After contacting sitecore Support and sending CPU/Memory Dumps, The support team responded :

"Due to Glass Mapper often resolving item paths Sitecore needs to update records in ItemPaths cache ( where every update "locks" the cache ). As this seems to happen often the application would encounter the situation when a few threads will be waiting for a single thread to finish updating ItemPaths cache."

So, have you encountered such issue before? is there anything i need to do with our Glass models to prevent this?

"Glass.Mapper" version="3.0.11.23"

"Glass.Mapper.Sc" version="3.1.10.31"

Thanks

Was it helpful?

Solution

The issue was in our base class which contains "Full Path" property:

public virtual string FullPath { get; set; }

This means that each time item is loaded by glass it will hit the path cache, which was causing the slowness.

I have updated the property to be more like 'Lazy Loaded' property:

[Glass.Mapper.Sc.Configuration.Attributes.SitecoreIgnore()]
public string FullPath {
   get
   {
      return FullPath();\\This method retrieve FullPath from item.Paths.FullPath
   }
}

This fixed the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top