Sitecore page load slowness

Viewed 317

I'm using Sitecore instance 9.1, Solr 7.2.1, and SXA 1.8.

I have deployed the environment on Azure and while monitoring incoming requests (to CD instance), I've noticed slowness in loading some pages at specific times.

I've explored App Insights and found an unexplainable behavior the request is taking 28.7 seconds while the breakdown of it shows executions of milli-seconds .. How is that possible? and How to explain what's happening during extra 28 seconds on the app service ??

enter image description here

I've checked the profiler and it shows that the thread is taking only 1042.48 ms .. How is that possible ?

enter image description here

This is an intermittent issue happens during the day .. regular requests are being served within 3 to 4 seconds.

3 Answers

I noticed that Azure often shows a profile trace for a "similar", but completely different request when clicking from the End-to-end transaction view. You can check this by comparing the timestamp and URL of the profile trace and the transaction you clicked from. For example, I see a transaction logged at 8:58:39 PM, 2021-09-25 with 9.1 s response time: End-to-end transaction

However, when I click the profile trace icon, Azure takes me to a trace that was captured 10 minutes earlier, at 08:49:20 PM, 2021-09-25 and took only 121.64 ms: Linked profile trace

So, if the issue you experience is intermittent and you cannot replicate it easily, try looking at the profile traces with the Slowest wall clock time by going to Application Insights → Performance → Drill into profile traces: enter image description here

This will show you the worst-performing requests captured by the profiler at the top of the list: Slowest wall clock time

In order to figure out why it is slow, you’ll need to understand what happens internally, f.e:

  • How the wall clock time is spent while processing your request?
  • Are there any locks internally?

The source of that data is dynamic profiling, Azure can do that on demand.

The IIS stats report would show you slowest requests, so you could look into Thread Time distribution to see where those 28 seconds are spent: enter image description here

In Sitecore the when the application start the Initial prefetch configuration allows to pre-populate prefetch caches. Pre-heated prefetch caches help to reduce the processing time of incoming requests. The initial prefetch configuration of caches are taking time to load on initial stage.

Sitecore XP instance takes too long to load. This is caused by a performance issue in the CatalogRepository.GetCatalogItems method. It will be fixed in upcoming updates

see Site core knowledge base

In Sitecore XP 9.0 the initial prefetch configuration was revised. The prefetch cache for the core database was configured to include items that are used to render the Sitecore Client interface.

The Sitecore Client interface is not used on Content Delivery instances. Disabling initial prefetch configuration for the Core database helps in avoiding excessive resource consumption on the SQL Server hosting the Core database.

Change the configuration of the Core database in the \App_Config\Sitecore.config file:

enter image description here

Refer site core knowledge base

Related