Developer forum

Forum » CMS - Standard features » Page really slow after being inactiv for some minutes/hours

Page really slow after being inactiv for some minutes/hours

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

 

We have a search page, that we load in a typeahead via Ajax Load.

Normaly the responstime is really good (around 50 msec.)

But if the page has been inactive for some time (minutes or hourst - not days) - it becomes really slow for the first intial load. Up to 16 seconds, and that of course is completely nogo for a typeahead serch. It´s as if the page goes in to hybernation. After being triggered again, it runs perfectly as long as it is called reuglarly, but at the first chance - it goes back into hybernation.

What to do?

 

br

 

Hans


Replies

 
Nicolai Pedersen
Reply

Hi Hans

You will have to debug what happens when the page 'sleeps' and gets waken again. It is hard to tell what that can be.

BR Nicolai

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Turns out on the search page, the index queries are extremely slow on first run after sleep. Takes more tham 2 seconds. pr query. After that first run, it only takes 2 to 3 milliseconds. How can this be improved?

 

On normal pages, these are two examples of sinners that take more than 2 seconds to render

After Run (E:\Dynamicweb.Net\Solutions\landsverk.dw9.dynamicweb-cms.com\Files\Templates\Designs\LV\_parsed\subpage.parsed.cshtml)

and

CreateDataReader - took: 0 ms.
USE [landsverk]
DECLARE @p0 NVARCHAR(2) = N'55'
SELECT [ItemType_01_Introduction].[Id], [ItemType_01_Introduction].[Sort], [ItemType_01_Introduction].[ItemInstanceType], [ItemType_01_Introduction].[Yvirskrift], [ItemType_01_Introduction].[Tekst], [ItemType_01_Introduction].[Mynd], [ItemType_01_Introduction].[Puncline], [ItemType_01_Introduction].[Anchors], [ItemType_01_Introduction].[Farvuskema], [ItemType_01_Introduction].[FjalPil] FROM [ItemType_01_Introduction] AS [ItemType_01_Introduction] WHERE ( [ItemType_01_Introduction].[Id] IN (@p0) )
System.Data.IDataReader CreateDataReader(System.Data.IDbCommand, System.Data.CommandBehavior) (Dynamicweb.Data.dll) in :0
System.Data.IDataReader CreateDataReader(Dynamicweb.Data.CommandBuilder, System.Data.IDbConnection, System.Data.IDbTransaction, System.Data.CommandBehavior, Int32) (Dynamicweb.Data.dll) in :0
System.Data.IDataReader CreateDataReader(Dynamicweb.Data.CommandBuilder, System.Data.IDbConnection, System.Data.IDbTransaction, Int32) (Dynamicweb.Data.dll) in :0
System.Collections.Generic.IEnumerable`1[Dynamicweb.Content.Items.Item] SelectInternal(System.Collections.Generic.IEnumerable`1[System.String], Dynamicweb.Content.Items.Queries.Query) (Dynamicweb.dll) in :0
System.Collections.Generic.IEnumerable`1[Dynamicweb.Content.Items.Item] SelectByIds(System.Collections.Generic.IEnumerable`1[System.String], Dynamicweb.Content.Items.Queries.Query, Boolean, Boolean) (Dynamicweb.dll) in :0
System.Collections.Generic.IEnumerable`1[Dynamicweb.Content.Items.Item] SelectByIds(System.Collections.Generic.IEnumerable`1[System.String], Dynamicweb.Content.Items.Queries.Query, Boolean) (Dynamicweb.dll) in :0
Dynamicweb.Content.Items.Item SelectById(System.String, Dynamicweb.Content.Items.Queries.Query) (Dynamicweb.dll) in :0
Dynamicweb.Content.Items.Item GetById(Dynamicweb.Content.Items.Metadata.ItemType, System.String, Boolean, System.DateTime) (Dynamicweb.dll) in :0
Dynamicweb.Content.Items.Item GetById(System.String, System.String, Boolean, System.DateTime) (Dynamicweb.dll) in :0
Dynamicweb.Content.Items.Item GetItem(System.String, System.String) (Dynamicweb.dll) in :0
Dynamicweb.Content.Items.Item get_Item() (Dynamicweb.dll) in :0
Dynamicweb.Frontend.ParagraphViewModel CreateInstance(Dynamicweb.Content.Paragraph, Dynamicweb.Frontend.ContainerInfo, Dynamicweb.Frontend.PageView) (Dynamicweb.dll) in :0
System.String RenderParagraph(Dynamicweb.Content.Paragraph, Dynamicweb.Frontend.ContainerInfo) (Dynamicweb.dll) in :0
System.Collections.Generic.IDictionary`2[System.String,System.String] CreateContent(System.Collections.Generic.IList`1[Dynamicweb.Content.Paragraph]) (Dynamicweb.dll) in :0
System.Collections.Generic.IDictionary`2[System.String,System.String] CreateContent(Int32) (Dynamicweb.dll) in :0
Void RenderPage(Dynamicweb.Rendering.Template, Dynamicweb.Frontend.PageViewModel) (Dynamicweb.dll) in :0
Void SetPageTemplateValues() (Dynamicweb.dll) in :0
System.String Output() (Dynamicweb.dll) in :0
Void ProcessRequest(System.Web.HttpContext) (Dynamicweb.dll) in :0

 
Nicolai Pedersen
Reply

Can you make a screendump of the debugging with timings where they are slow?

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Here are a few screendumps

You could also try one of these pages (If they are fast when you hit them, it´s because they are awake. You have to hit them when tey are not awake)

 

http://landsverk.dw9.dynamicweb-cms.com/?id=451&debug=true&Leita=Lands

 

http://landsverk.dw9.dynamicweb-cms.com/?id=8&debug=true

 

Regards Hans

 

Screen_Shot_2017-06-11_at_2.37.11_PM.png Screen_Shot_2017-06-11_at_2.38.32_PM.png Screen_Shot_2017-06-11_at_2.38.54_PM.png

 

You must be logged in to post in the forum