I’m hosting my Umbraco 15 website on Azure. My plan is Standard S1.
When I’m sending a newsletter, or just traffic increase (because of social media posts, etc.), Instance count jump to 8, and yet, the website is crashing! Is it make sense?? It cost $73 / month and can’t handle some traffic???
(In a shared host I’d get a better performance …)
So now when I’m sending newsletter I change the plan to Premium v3 P0V3, then it stable. Problem is that the Premium v3 P0V3 cost $127 / month …
And here are my questions:
Is it Umbraco / my website or that Azure is just a bad service?
Like, is there something I can do to make the website more efficient ?
Like, it’s a simple magazine website, the code is not that complicated and I don’t have plugins / packages, etc. A standard code
It doesn’t make sense. Where I’d start would be the Umbraco logs. I would search for any exceptions or out of memory errors that could be an indication.
What Soren also suggested makes sense. Maybe, unwillingly, you’re doing one of the things mentioned there that contribute to your website being overloaded. It could be something as simple as getting a huge collection in memory every time you load a list without using caching, or making a content query that just returns too much. These things tend to create issues only on higher traffic scenarios.
Hi, thanks.
Which logs? At Umbraco back office or Azure kudu ?
Also, what should I look for in the logs?
How can I know what causes the issue ?
My code is pretty simple - at home page I take the latest news items from each category, then click on each of them takes to the article, which I get the document’s information, etc. Pretty simple. I looked at the link which Soren put and didn’t find something from there in my code
This for example a typical section at the home page (in the link it’s still the V11 code because haven’t pushed yet to my github the V15, but very similar - my current code just with the changes to 15):
Is anything wrong in this code?
And this for example the code to display posts for each category:
I’ve had a very quick look at your repo. Nothing immediately jumps out but the following things will help:
Review your use of the ‘@’ - this is just to put Razor variables into markup - within c# blocks it’s possibly causing some weirdness.
Lines like this below
var photonics_pagesToList = @photonics_node.Children.Where("Visible");
: the @photonics is unneeded - just photonics_node.Children
You’re mixing the use of partials and macros (in how you call these partials from your page layout master template and on the pages. I think you can just use partial views based on what I can see. Then you can cache too… (see next point) Partial Views | Umbraco CMS
Cache - for every page load your making this site traverse all these nodes - things like navs and side bars with links are not changing so use caching. You can control if the cache is the same site wide or different for each page (e.g. the main nav might be the same site wide if you don’t have any current page context) and the side bar related links is likely per page.
@await Html.CachedPartialAsync("ArticleImgHandler", Model, new TimeSpan(0, 1, 0, 0), true, false)
// the first true is cache by page - for a site wide you can have false.
But definitely look at the logs - check in the Settings section in Umbraco and look at what happens at the time of the crashes. My guess is in the use of macros when you don’t need them and your accessing of Umbraco media.