Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brad 69 posts 97 karma points
    Nov 12, 2014 @ 16:17
    Brad
    0

    EXTREMELY slow page loading speed

    After importing a bunch of articles from a previous CMS (15,000+) into Umbraco, my page load speeds have increased to basically making the site unusable. The homepage is currently taking 15+ seconds to load.

    1. I'm basically excusluvely using DynamicNode
    2. I tried enabling caching for macros as much as I could, but I am using usercontrols so I'm not sure if those even cache.
    3. I am using 301 Url Tracker, disabling this doesn't seem to fix the problem.
    4. Server is currently at 73% physical memory usage. It is not shared hosting, but a cloud server on rackspace.

     

  • Brad 69 posts 97 karma points
    Nov 12, 2014 @ 16:42
    Brad
    0

    Just wanted to update that if I unpublish all the articles the pages load instantly.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 13, 2014 @ 11:39
    Alex Skrypnyk
    0

    Hi Brad,

    What content is rendered on the home page ? How many nodes are you using on the home page ?

    Thanks

  • Brad 69 posts 97 karma points
    Nov 13, 2014 @ 16:37
    Brad
    0

    Hi Alex, Thanks for the help.

    I'd like to add that the homepage isnt the only page that is slow whenever the published node count gets high. Even simple text pages are much slower than without the high amount of published nodes. But here is a list of the macros on the homepage:

    Recursive Menu: Razor script that renders the menu based on a "menu" document type

    Latest News: User control that gets the newest news articles for homepage

    Dim home = New DynamicNode(Node.GetCurrent())
    
    Dim articles = home.DescendantsOrSelf("News").Where(Function(k) k.GetPropertyValue("isConference") = False).FirstOrDefault().DescendantsOrSelf("NewsPost").OrderByDescending(Function(x) x.CreateDate).ToList()
    

    Featured Articles: pretty much same as latest news Featured Columns: same as latest news Featured Video

    Return Helper.GetProperty(New DynamicNode(-1).Descendants("Video").FirstOrDefault().Id, "embedSnippet")
    

    Data Tables:

    root.Descendants("DataTable").ToList()
    

    As you can see there isn't really anything intensive I'm doing. They're all basically searching the descendants of home by document type.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 13, 2014 @ 16:40
    Alex Skrypnyk
    0

    Brad,

    root.Descendants() are very expensive operation, maybe you can replace it somehow ?

  • Brad 69 posts 97 karma points
    Nov 13, 2014 @ 17:21
    Brad
    0

    Thank you Alex this is definitely helping. I have removed all the ones I can and it seems much faster. A couple queries that are still slow I can't think of a way to optimize differently. The Latest News, and anything relating to the articles.

    The news is structured like this: News / Year / Month / Day So I'm still calling News.Descendants. Is there a better way to do this? Should I grab the last 2 months exclusively?

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 13, 2014 @ 17:34
    Alex Skrypnyk
    0

    Brad, There are several way to do that. 1) Get latest year Node from news node, then get latest 2 months nodes from that year. Without Descendants(), just Chinldren() or .FirstOrDefault()

    2) Try to cache last news block.

    3) Add some property to the news section with latest news selector and set latest news manually.

    Thanks

  • Brad 69 posts 97 karma points
    Nov 14, 2014 @ 00:10
    Brad
    0

    Hi Alex,

    I have gone with your suggestion and implemented a simple caching layer between umbraco and my website that uses the context cache. I had a question though. I converted a very simple dynamicnode list query to use the cache, and the difference in speed is around 100ms vs 5s+. Why is umbraco's own caching mechanism so slow? Is it somehow behind the scenes accessing umbraco.config?

    With simple caching (100ms):

    Dim children As New List(Of DynamicNode)
    
    If SimpleCache.IsInCache("news") Then
        children = SimpleCache.GetFromCache("news")
    Else
        children = New DynamicNode(Node.GetCurrent()).Descendants("NewsPost").OrderBy(Function(x) x.CreateDate).ToList()
        SimpleCache.Insert("news", children)
    End If
    

    No caching: (5s+)

    lvData.DataSource = New DynamicNode(Node.GetCurrent()).Descendants("NewsPost").OrderBy(Function(x) x.CreateDate).ToList()
    lvData.DataBind()
    
  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 14, 2014 @ 08:33
    Alex Skrypnyk
    0

    Hi Brad,

    I think it's because of .Descendants("NewsPost"), that method get all nodes behind current and you site has a lot of news. Also try to look to the IPublishedContent class.

    You can find more info here: http://our.umbraco.org/Documentation/Reference/Mvc/querying. You can't use the DynamicNode and IPublishedContent together. It's better to only use IPublishedContent and also query with that.

    THanks

Please Sign in or register to post replies

Write your reply to:

Draft