Performance issues with IContentRepository methods

Vote:
 

Hi Team,

My application is facing lot of performance issues with IContentRepository methods. Always first requesting is taking minimum of 10 seconds to get any content page by using IContentRepository.Get<T>(ContentReference contentLink) method. From sencond request onwards it is quick.

Whenever application is in ideal state for 15min then first request always taking so much time to get the data. Because of this few of customers are facing performance issues.

I have idea that Episerver caches the content first time and from next time onwards retrieve from cache for quick response. I am not understanding why Get method is taking lot of time to retrieve when system is in ideal for sometime.

Am i missing any configuration settings? My current application is running in DXC environment.

Thanks,

Suresh B

#218168
Mar 06, 2020 17:53
Vote:
 

I believe the default cache timeout for object cache is 12 hours - check the settings in web.config (episerver/applicationSettings - pageCacheSlidingExpiration-attribute) that you have not set a too short timeout for this. If you're in edit-mode, the pages are not loaded from cache, this is normal. 

If the cache settings look good and you're still seeing that the pages are not loaded from cache after a few minutes, this sounds like the application pool is being recycled. This could happen if you have a lot of exceptions that occur in a short time span so the IIS rapid fail protection is triggered - check the logs for any exceptions.

If you're still having problems, and it works as expected in your development environment, you should contact Episerver support who will hopefully be able to assist.  

On a side note, you should use IContentLoader instead of IContentRepository if you don't need to save/update content. 

#218169
Mar 06, 2020 19:45
Vote:
 

Hi Tonvang,

Thanks for your update. applicatioSettings looks good and there are no application level exceptions.

May be i need to check with Episerver support team.

Thanks,

Suresh B

#218193
Mar 07, 2020 12:23
Vote:
 

I would suggest to do a profiling of your request (using dotTrace is preferred) and send the result to the support team, that will speed up the process 

#218238
Mar 09, 2020 7:28
Vote:
 
  1. Avoid having more than 100 immidiate children if possible. Add additional folder if needed to structure content. Good for editors, good for performance. 
    If you have news content, structure by year and month. If you have products, structure by category etc.
  2. If you have extremely many children below a single node (1000s) in tree you will get poor performance in edit mode and also for the GetChildren method in content repository. Solve this preferably by solving 1 above.
  3. Use GetBySegment on ContentRepository if possible when you have lots of children. Read more here

https://world.episerver.com/blogs/Daniel-Ovaska/Dates/2019/3/performance---getchildren/

4. Avoid doing recursive searches in page tree / FindPagesByCriteria. Use Episerver Find or similar to get what you need instead or solve it in another way. And if you do use recursive search in tree, cache the result for the public user so you at least only do it once.

#218241
Edited, Mar 09, 2020 10:35
Vote:
 

Hi Daniel,

Can we use "GetDescendants" to get all childrens under folders? Is this "GetDescendants" results get from content cache or from database?

Thanks,

Suresh B

#218293
Mar 10, 2020 16:10
Vote:
 

Note that GetDescendents will be recursive, and it only returns the references of the descendents, not the descendents themselves. The default implementation uses GetChildren to get the direct children, so it will be cached or uncached, but then use direct database access (uncached IIRC) to get deeper level descendents 

#218294
Mar 10, 2020 16:16
Vote:
 

Hi Quan,

Let's say i have below folder structure.

Occupations

 -Industry1

  -Occupation1

  -Occupation2

 -Industry2

  -Occupation3

  -Occupation4

So here i have around 6000+ occupations categorized with industry folder structure. What is the best way to retrieve all occupations across all industries without performance impact?

I have requirement to show all occupations in searchable dropdown. I cannot use Episerver Find as it will return max 1000 records and i need to hit find service min 6 times to get all occuaptions.

#218295
Mar 10, 2020 16:29
Vote:
 

Do you really need to display all 6000 occupations initially? If you use some searchable Javascript dropdown component you can create a rest api endpoint that searches Find and delay searching until the user has entered 2-3 characters or so. 

#218315
Mar 10, 2020 21:15
Vote:
 

Yes, i need to display 6000 occupations. My requirement is, user can search or select from dropdown.

#218340
Mar 11, 2020 4:13
Vote:
 

Your best option would be using an indexed search, like, Find, to load/search all contents instead of using the content API directly 

#218342
Mar 11, 2020 7:24
Vote:
 

Even if you have to hit Find six times, it will still be faster than loading from DB. You can then cache the results, so it will only hit Find the first time. 

#218346
Mar 11, 2020 8:02
Vote:
 
  1. Question the requirement. 
    It's probably best to first choose Industry first, and the show occupations below that using a paged result or similar. Usually there is a way around to avoid loading 6000+ entities at the same time.
  2. Use Find and get the result per Industry. 
  3. Cache it. Hard. That's not a call you want to make on a per user basis...
#218352
Mar 11, 2020 10:43
Vote:
 

We are planning to change occupation selection behavior. Now going to integrate autosuggestion behavior.

I am referring below link for Episerver Find autocomplete example. Do we have any option to pass pagetype filter so i can only filter Occupations and get occupation specific results.

https://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/11/searching-with-javascript/Autocomplete/

#218396
Mar 12, 2020 7:53
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.