Copied to clipboard

Flag this post as spam?

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


  • Nathan 67 posts 146 karma points
    Mar 12, 2019 @ 18:52
    Nathan
    0

    Slow site in Azure (using UmbracoFileSystemProviders for media)

    Hi all,

    So far we have yet managed to pinpoint the root cause of why our site - recently migrated to Azure - is loading very slow at times, usually when more users are on the site (>200 users).

    Setup:

    • WebApp: P1V2 (3.5 Gb, 2 cores) - resource consumption indeed is high most of the time both for CPU and memory and close to maxing out when more users are on the site
    • Umbraco DB: S0:10DTUs - no performance issues detected here
    • Umbraco version 7.13
    • Offload static files to blob storage + CDN via UmbracoFileSystemProviders.Azure

    Before scaling up the Azure service plan, we would first like to eliminate other potential issues that might cause this, related to either Umbraco or how we handle images via the UmbracoFileSystemProviders.Azure.

    We've made some changes to improve the performance on azure recommended here, to examine indexes, fcnMode, logs etc. but did not help.

    We're suspecting that this may be related to how the images load via the Image Processor Azure File System Provider implementation, as a test on tools.pingdom.com shows waiting times for images of even 10 seconds when loading them traditionally like /media/1234/image.png versus loading images directly from the CDN + storage: https://cdn.mysite.com/site-media-blob/image.png which takes a couple of miliseconds.

    Where are not sure if we've configured the Azure File System Provider incorrectly or if there are redirects behind the scenes for each image that can cause a high load on the server.

    We've read on the forums that it's possible to inject the CDN path into templates rather than rely on the media virtual path provider to remove the initial 302 requests for each and every image? Would this help? How exactly can we do this?

    Other ideas?

    Thank you for your help.

  • SteveV 54 posts 240 karma points
    Mar 12, 2019 @ 19:28
    SteveV
    0

    What parts of your site are slow and how slow are they? Does it take too long to load the initial HTML page or is it the images? How long does it take to load?

  • Nathan 67 posts 146 karma points
    Mar 12, 2019 @ 20:04
    Nathan
    0

    Hi Steve, right now it's rather the case that the initial HTML page takes long to load between 5 to 15 seconds sometimes.

    But we have also noticed from time to time that the page and HTML loads fast but the images load after the rest of the page with a 2-3 seconds of delay.

    Any ideas? thanks.

  • SteveV 54 posts 240 karma points
    Mar 12, 2019 @ 20:38
    SteveV
    0
    1. As you know about ASP.NET the first request after a deployment or restart is always slow. Is the 5-15 seconds load time consistent between reloads?
    2. Do you have the DotNetCompilerPlatform Nuget package in your project? Make sure it's at least v1.0.8 otherwise pages with a lot of partial views will have a high load time (this only impacts that 1st request or a view that hasn't been visited before).
    3. Are all the Imageprocessor Nuget packages up to date? Did you follow this guide completely (skip the .NET 4.5-is-required part, you can use 4.6 or 4.7).
    4. Can you confirm that the imageprocessor is working and cropping images?
    5. Does the website run on more than 1 server?
  • Nathan 67 posts 146 karma points
    Mar 12, 2019 @ 21:14
    Nathan
    0
    1. We don't take into consideration the loading times immediately after a deployment. The 5-15 seconds load time usually happens when there are more users on the site.

    2. Yes - v. 2.0.0

    3. No, see below. I did not follow that guide, I followed this one.

    enter image description here

    1. If by that you mean loading an image like /media/12345/image.jpg?rnd=20190312220613&width=400&animationprocessmode=first, then yes it loads, but takes about 13 seconds to load if I change for example the width param value.

    2. Only 1 server used.

  • Nathan 67 posts 146 karma points
    Mar 12, 2019 @ 21:21
    Nathan
    0

    In the FileSystemProviders.config the rootUrl we set directly to the CDN domain like:

    <add key="rootUrl" value="https://cdn.mysite.com/"/>
    

    Which is a custom domain set for the CDN in Azure.

    And not e.g.:

    <add key="rootUrl" value="http://[myAccountName].blob.core.windows.net/"/>
    

    Do you think the above would be an issue?

    Also wanted to note that in web.config, the UseAzureCdnToolkit property is set to false.

    <add key="AzureCDNToolkit:UseAzureCdnToolkit" value="false" />
    

    Any ideas? thanks.

  • SteveV 54 posts 240 karma points
    Mar 12, 2019 @ 21:42
    SteveV
    0

    I haven't seen the full Youtube video but that video and Cultiv's guide are pretty old now and you can largely ignore them. Most of the issues that people were having using Umbraco in Azure have been solved.

    These days I follow these 2 guides to setup a website in Azure:

  • SteveV 54 posts 240 karma points
    Mar 12, 2019 @ 22:03
    SteveV
    0

    For rootUrl I would use the *.blob.core.windows.net url. You should only set the CDN url in the cache.config file.

    I don't have experience with AzureCDNToolkit. It's an old package that hasn't seen an update in recent times.

    Also, make sure you have the memoryMaxMinutes="60" attribute in your cache.config file. It makes a difference performance wise.

  • Dieter 5 posts 85 karma points
    Mar 13, 2019 @ 08:31
    Dieter
    0

    Hello SteveV

    I see that the Media Setup link is targeting Umbraco Cloud sites. Is the procedure the same for a regular Umbraco site?

    Thank you for your clarification. I'm in the same boat so it's quite helpful.

    Dieter

  • SteveV 54 posts 240 karma points
    Mar 13, 2019 @ 16:14
    SteveV
    1

    If you use Azure Websites you can use this guide too for storing media (and forms) in the Azure Blob Storage.

  • Nathan 67 posts 146 karma points
    Mar 13, 2019 @ 16:52
    Nathan
    0

    Something that I noticed when using https://tools.pingdom.com/ to identify what about our website is slow, we see that the requests to images via the normal relative media paths, like e.g. below:

    https://www.mysite.com/media/423423/some-image.jpg //via umbraco razor helpers
    

    Some of them sometimes have up to 5-10 seconds waiting times, whereas requests to images direclty via the CDN, like e.g. below:

    https://cdn.mysite.com/site-blob/94229/some-other-image.jpg
    

    Have significantly lower times < 100ms.

    Why is that? could it be because of the resolver, consuming a lot of server resources for each image request? is that normal?

  • Saif Obeidat 79 posts 296 karma points
    Feb 15, 2020 @ 08:18
    Saif Obeidat
    0

    Hi Nathan, have you found a solution?

  • Nathan 67 posts 146 karma points
    Feb 15, 2020 @ 10:35
    Nathan
    0

    The solution for us was to scale up the app service tier, after which all problems went away. Scaling up to P2V2 fixed our issues.

Please Sign in or register to post replies

Write your reply to:

Draft