Copied to clipboard

Flag this post as spam?

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


  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 10:41
    David Hammer
    0

    Umbraco Performance Really slow

    Hey folks,

    I have created this umbraco site: http://notat.deo.ngoweb.dk

    I have disabled the macrocaching for now, and by default, it takes me up against 8,5 seconds to load the front page, and up towards 11,5 seconds to load "Artikler"

    This is the information I am able to provide at this point:

    My Umbraco version is: v6.1.6

    I am running almost only razor macros.

    I am hooked up to a SQL Database

    I am using XSLT Search (which is even more slow - up towards 20 seconds to load results)

    I got about 3,500 nodes with magazines and articles.

    Would you guys take a look at the Debug Trace, and tell me what the hell I have messed up so bad? In my experience Umbraco is fairly quick, but this time it is just really really slow

    Thank you so much for any response!

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Apr 09, 2014 @ 10:45
    Niels Hartvig
    0

    Looking at the debug trace there's room for improving your queries in your razor macros as it's those that are slow. If you post some of your razor views, maybe someone could give you feedback on optimising those queries.

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 10:50
    Alex Skrypnyk
    0

    Hi David,

    Why do you use XSLT Search ? maybe you can use your custom Examine Search ?

    Thanks, Alexandr

  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 11:20
    David Hammer
    0

    Hey Niels,

    My "Navigation.cshtml" looks like this:

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using umbraco.MacroEngines;
    @{  
        var root = Model.AncestorOrSelf(1);
    }
    <ul class="nav navbar-nav">
    @{ 
      var homeSelected = Model.Level == 0 ? " class=\"active\"" : string.Empty; 
    }
    @if(root.umbracoNaviHide == false) 
    { 
      <li @Html.Raw(homeSelected)>
        <a href="@root.Url">
          @root.Name
        </a>
      </li>
    }
      @foreach (var item in root.Children.Where("Visible"))
      {
        var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : string.Empty; var subItems = item.Descendants().Where("Visible"); 
    
        if (subItems.Count() > 0 && item.contentDropDown == true)
        {
          <li class="dropdown"> 
            <a href="@item.Url" class="dropdown-toggle" data-toggle="dropdown">@item.Name 
              <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
              @** WHERE Level==3 LOADS ONLY THE CHILDREN OF THE 2nd LEVEL **@
              @foreach (var subItem in subItems.Where("Visible").Where("Level == 3"))
              {
              <li><a href="@subItem.Url">@subItem.Name</a></li>
              }
            </ul>
          </li>
        }else
        {
            if(item.umbracoNaviHide == false) 
            { 
                <li @Html.Raw(selected)><a href="@item.Url">@item.Name</a></li>
            }
        }
      }
    

    And it takes approx. 1.17 seconds to load.. Have I completely misunderstood how to traverse the tree or?

    Thanks so much for the help!

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 11:51
    Alex Skrypnyk
    0

    Hi david,

    I think you have problem in this line

    @foreach (var item in root.Children.Where("Visible"))
    

    You call each node under rood. Try to specify your select before foreach. Something like that:

    @foreach (var item in root.DescendantsOrSelf("YOUR DOC TYPE").Where("Visible"))
    
  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 12:08
    David Hammer
    0

    Hey Alex,

    Hmm I can see where you are getting at, but yeah I'm having trouble selecting the specific doc type in the foreach.

    Because of my structure, I have frontpage first, and under that, magazines, articles and more.. All these have different docTypes due to having different generic properties.. How can I select a specific doctype, if they are all different.. and is there any other thing to do other than calling Children? (if that is bad practice)

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 12:10
    Alex Skrypnyk
    0

    Could you show me your tree with doctypes? I'm sure that we will find solution together )

    Thanks, Alex

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 12:10
    Alex Skrypnyk
    0

    Also you can create custom Examine index.

  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 12:32
    David Hammer
    0

    Hey Alex,

    http://i.imgur.com/Txd7vkK.png

    There it is, hope it can shet some light on whats wrong :/

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 12:53
    Alex Skrypnyk
    0

    Interesting structure. This all information do you need for start page ? We have to separate data somehow.

  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 13:14
    David Hammer
    0

    The reason Why I put all the content under Frontpage is only for it not to show in the navigation :-) It did that because I use ".Children", so had to do like Fronpage.Children to show the navigation..

    How would you recommend that I proceed from here, while having it in mind that it should all result in faster performance :/?

  • Alex Skrypnyk 6162 posts 24132 karma points MVP 8x admin c-trib
    Apr 09, 2014 @ 14:17
    Alex Skrypnyk
    0

    Navigation items you can put in Cache. Fill that cache in application_start and than don't touch umbraco tree. What about other performanca issues ? Where do you have some bottleneck ?

  • David Hammer 41 posts 67 karma points
    Apr 09, 2014 @ 17:17
    David Hammer
    0

    Hey Alex,

    Im not sure I understand what you mean with application_start?

    Sure I can cache several macro's like the boxes to the right, the navigation, the footer and such.. But when the cache runs out, It's still really slow, and really it shouldn't be that slow for such a small site?,

    Otherwise, actually all my macros are really slow, they are all between 1 and 2 seconds on load time each :/, thats why I suspect there might be something severely wrong some other place :/

Please Sign in or register to post replies

Write your reply to:

Draft