Copied to clipboard

Flag this post as spam?

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


  • Simon 47 posts 107 karma points
    Feb 21, 2018 @ 18:05
    Simon
    0

    Need help finding the right balance: ModelsBuilder, Performance, and Stability

    Using Umbraco version 7.4.3 assembly: 1.0.5948.18141

    A little history on our setup and dilemma:

    • The site has many thousands of content pages and media. While the visitor count is on the low side, the amount of data/content stored in umbraco is on the large side.
    • Site performs very slow at peak times and slow overall. Some of this might be less than ideal code but it should help paint the picture.
    • There is a process that uses the ContentService and finds all content of a specific type and updates a few properties. Regardless of time of day, this will frequently crash due to execution timeout. There are approximately 2000 pages of this doctype and the execution timeout is 1 hour.
    • When using ModelsMode = PureLive, the site will eventually crash due to the lock error: Failed to enter the lock within timeout. at Umbraco.Core.AsyncLock.Lock
      • Inspecting the Umbraco log, it looks like this can be traced back to Umbraco attempting to recompile the models and then failing and needing to restart: Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: MaxRecompilationsReached
    • Disabling ModelsMode caused the front end of site to fail since we use models all over. The idea of this setting sounds more stable and fast but I am not sure how to get it setup correctly without recoding the entire site since we use models everywhere. The idea came from this link.
    • Changing ModelsMode = Dll seems to slow the site down even further while introducing increased stability.

    So, our main goal here is to figure out how to setup the site to have optimum performance (e.g. increase general site speed and have the content service find and update records in minutes instead of hours++) while also greatly reducing the number of site crashes/stalls. I feel like the answer lies in some clandestine combination of configuration settings that I haven't been able to find or figure out yet.

    Thanks for any help on this topic.

  • Nigel Wilson 918 posts 2007 karma points
    Feb 21, 2018 @ 18:41
    Nigel Wilson
    0

    Hi Simon

    In terms of site performance, I would love to provide thoughts feedback... I have an obsession with site performance and so really focus on options in that respect.

    If you'd prefer to not share the URLhere, feel free to email me at nigel@optimised.net.nz.

    Cheers, Nigel

  • Simon 47 posts 107 karma points
    Feb 21, 2018 @ 18:43
    Simon
    0

    Unfortunately, I cannot provide a link as its a gated site with specific requirements for access.

  • Nigel Wilson 918 posts 2007 karma points
    Feb 21, 2018 @ 18:52
    Nigel Wilson
    0

    Hi Simon

    Appreciate the issue.

    Is there a way to run Google Page Speed on the site ? Possibly a silly question, but thought I'd ask - it has proven invaluable for me in optimising sites. https://developers.google.com/speed/pagespeed/insights/

    I don't do anything "special" but certainly consistently do:

    1. Bundling and minification
    2. All JS at the foot of the page
    3. Update the web.config in the

    1. Where possible use the built in image processor to ensure images are served at an appropriate size - this may or may not be an issue for your site, but if a large image is uploaded, then by simply adding ?width=2000 (or whatever is appropriate) to the image URL you can ensure you aren't sending a multi Megabyte image down the wire.

    So these are simply a few things off the top of my head that I focus on in terms of front end delivery.

    Hope it is helpful.

    Nigel

  • Simon 47 posts 107 karma points
    Feb 21, 2018 @ 18:55
    Simon
    0

    The site speed issue is pre-render vs slow images, js, etc. Once we get the backend figured out, the front end stuff is much more manageable.

  • Pawel Bres 39 posts 160 karma points c-trib
    Feb 21, 2018 @ 19:32
    Pawel Bres
    0

    it's really strange that changing from LiveModels to Dll slows down the site.

    the issue with ContentService might be also related to index rebuilding, could you check if you have set examine indexes to run async?

    you can also review your code against this article

  • Bo Damgaard Mortensen 712 posts 1189 karma points
    Feb 21, 2018 @ 19:33
    Bo Damgaard Mortensen
    0

    Changing ModelsMode = Dll seems to slow the site down even further while introducing increased stability.

    Out of curiosity: for how long did you test this? Just the very first request? The first request will be slow after this change. Otherwise, I can't find a reason as to why it would be slower. Quite the contradictory.

  • Simon 47 posts 107 karma points
    Feb 21, 2018 @ 20:17
    Simon
    0

    I think you're right with this one. After the site has been running for a few hours now with this change, the speed is the same or perhaps better than before. The basic question I have, though, is what configuration leads to the fastest performance for a larger site? If it's to turn off ModelsBuilder how can we continue to use models in our razor views?

    Also, I'm still rather curious about the content service operations. I'll write some minimal and isolated code as a test and post an update here.

  • Nik 1153 posts 4741 karma points MVP 2x c-trib
    Feb 21, 2018 @ 21:32
    Nik
    0

    Hi Simon,

    I'm just wondering what you are doing with the content service.

    There is a process that uses the ContentService and finds all content of a specific type and updates a few properties. Regardless of time of day, this will frequently crash due to execution timeout. There are approximately 2000 pages of this doctype and the execution timeout is 1 hour.

    It's unusual to need to run a regular process to update content nodes. The problem with something like this is that each time you are saving and publishing these content nodes you are triggering the Examine indexes to rebuild AND the Umbraco Cache to refresh. The Publish also clears any other runtime caches as well, so if you are using CachedPartial, these are all getting cleared.

    Nik

  • Simon 47 posts 107 karma points
    Feb 21, 2018 @ 21:43
    Simon
    0

    It's an ecommerce site that uses an external ERP for inventory management. Instead of realtime bulk inventory updates we opted to do a timed process that runs every 2 hours. Is there another way to do a bulk update? I asked a while back if we can edit the data directly and I was extremely strongly advised not to do so.

  • Nik 1153 posts 4741 karma points MVP 2x c-trib
    Feb 21, 2018 @ 22:13
    Nik
    1

    Okay, so what sort of things are you updating al the time? Is predominantly stock levels?

    If so, I would have a content node for an inventory item, so if a new item exists in the sync process it creates a fresh node, if a node doesn't exist it removes it/unpublishes it/flags as discontinued. However once a node is created very little should need to change on it. Maybe a description update or a fresh picture. However you can perform all your checks against the publish cache rather than using the content service. Then if you find one that is diffent, and only then, do you use the content service to update and re-publish it.

    With regards to stock levels, which I imagine change all the time, you could either store the latest levels in a runtime cache (maybe with a database table storing latest figures incase off an app-restart). Then you are simply updating a seperate database table and your own cache rather than hitting the primary site cache. You might find something like this would work much better and you have alot more control over whats getting updated, stored and where. :-)

  • Nicholas Westby 1905 posts 6361 karma points c-trib
    Feb 21, 2018 @ 22:40
    Nicholas Westby
    0

    I would second what Nik said with regard to doing differential updates on an as-needed basis and storing the more dynamic data in separate tables.

    For some quick wins, I recommend the following:

    Note that if you need your Examine indexes to be up to date, you may have to manually trigger an index rebuild or automate that (I'm guessing Umbraco has a function to do that).

Please Sign in or register to post replies

Write your reply to:

Draft