1
votes

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

1
Hi Ahmed, this is this first time I have heard of this. Did they supply any further information. If this is a real problem I would be interested in solving this.Michael Edwards
If you can't post any more here you can contact me via mike At glass.luMichael Edwards
I've seen a situation where a base class with SitecoreInfoType.Url on a Url property and this caused a lot of ItemPaths usage. That could be the thing why Sitecore sees this behavior. We stopped using the Url infotype.RvanDalen
@RvanDalen what did you use instead?Michael Edwards
Do we have any answer to this?RG-3

1 Answers

3
votes

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.