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.
I'm basically excusluvely using DynamicNode
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.
I am using 301 Url Tracker, disabling this doesn't seem to fix the problem.
Server is currently at 73% physical memory usage. It is not shared hosting, but a cloud server on rackspace.
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
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?
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.
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()
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.
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.
Just wanted to update that if I unpublish all the articles the pages load instantly.
Hi Brad,
What content is rendered on the home page ? How many nodes are you using on the home page ?
Thanks
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
Featured Articles: pretty much same as latest news Featured Columns: same as latest news Featured Video
Data Tables:
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.
Brad,
root.Descendants() are very expensive operation, maybe you can replace it somehow ?
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?
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
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):
No caching: (5s+)
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
is working on a reply...