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
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?
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?
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.
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?
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).
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).
Can you confirm that the imageprocessor is working and cropping images?
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.
Yes - v. 2.0.0
No, see below. I did not follow that guide, I followed this one.
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.
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:
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:
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:
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.
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?
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.
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.
Yes - v. 2.0.0
No, see below. I did not follow that guide, I followed this one.
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.
Only 1 server used.
In the FileSystemProviders.config the
rootUrl
we set directly to the CDN domain like:Which is a custom domain set for the CDN in Azure.
And not e.g.:
Do you think the above would be an issue?
Also wanted to note that in web.config, the
UseAzureCdnToolkit
property is set to false.Any ideas? thanks.
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:
For
rootUrl
I would use the*.blob.core.windows.net
url. You should only set the CDN url in thecache.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 yourcache.config
file. It makes a difference performance wise.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
If you use Azure Websites you can use this guide too for storing media (and forms) in the Azure Blob Storage.
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:
Some of them sometimes have up to 5-10 seconds waiting times, whereas requests to images direclty via the CDN, like e.g. below:
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?
Hi Nathan, have you found a solution?
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.
is working on a reply...