How to Calulate ACU required by my Web APP - azure

I have a Web APP in Azure PAAS service App Service. App service plan uses a unit named as "ACU".
Is there any way by which i can calculate the number of ACU required by my web app.
As i have to do billing calculations so i need to prove that instance size chosen is based on some logical calulation.

Q. What is the Azure Compute Unit (ACU)?
A. The concept of the Azure Compute Unit (ACU) provides a way of comparing compute (CPU) performance across Azure SKUs.
The Azure Compute Unit (ACU) is used to help understand the
relative compute performance between different Azure series and size
VMs. It is based on the A0 (extra small) having a value of 50. A VM
with an ACU of 100 has twice the compute of a VM with an ACU of 50. A
VM with an ACU of 200 would be twice that of a VM with an ACU of 100
and so on.
So you should analyse the CPU Usage and Memory Usage.
For seeing that, you can go to your app service-->Diagnose and solve problems-->Availability and Performance.

The most important thing is NOT just considering ACUs for scalability and cost.
So you can Scale Up and Scale Out your App Service for meeting the demands during peak use and getting the final cost.
Vertical Scaling: For scaling up, since you don't initially know what kind of VM should suffice, you can start with a basic or intermediate one (not a very powerful one). General purpose Type VMs (50-210 ACUs) suffice in most cases. Link: https://learn.microsoft.com/en-us/azure/app-service/manage-scale-up
Horizontal scaling: It's good practice to also scale out your App service plan. You can autoscale and set up autoscaling rules or go the manual route.
Link: https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-get-started
Next you should monitor your CPU Usage and Memory Usage as suggested by Doris.
Additionally you can also go to Run History and see your usage:
Based on your findings you can tweak the number and kind of VMs you need.

Related

Azure app service plan obtain actual ACU usage

I have an EP1 app service plan that is hosting a function app.
The plan has 210ACU per month.
How do I find out how many of those I'm using?
(What happens if I run out?)
Azure Compute Unit (ACU) provides a way of comparing compute (CPU) performance across Azure SKUs.
Here you should analyze the CPU Usage and Memory Usage by going to the Diagnose and Solve problems > Availability and Performance:
In this case, you can Scale Up and Scale Out the App Service for meeting the demands during peak hours or you can increase the number of instances count.
Please check this SO Thread1 where I explained about how Scale Up and Scale Out methodology works.
Also, you can create the alerts using Azure Monitor for the app service on different quota exceeds like CPU usage, Memory Consumption, Request Failures, etc.

Understanding Azure Functions with App Service Plan

While creating an Azure Function. It provides an option to create an App Service Plan.
Let's say we select P2V2 which has 7GB Ram and 2 Cores. Here are the questions:
Let's say when the function is triggered, and each invocation consumes 1GB Ram. Does it mean that the same instance at maximum can concurrently run ~6 (leaving aside 1GB for OS let's say). Where all the 6 concurrent triggered functions re-use the same cores?
When does the App Service plan decide to scale out to multiple instances?
Yes, probably. As stated in Azure Functions hosting options - Service limits the number of Function apps per plan is unbounded, but:
The actual number of function apps that you can host depends on the activity of the apps, the size of the machine instances, and the corresponding resource utilization.
By default, an App Service Plan doesn't scale. In the same article I linked to before, it states that for a Dedicated Plan you can use Manual scaling or Autoscale. For autoscale, you control the rules.
For more information, see the documentation Juunas linked to in this comment.
Best practices for Autoscale

Different Azure services for WordPress hosting

maybe I should start that I am pretty new with Azure and I want to apologize in advance if my question is stupid. I am currently looking into the option to move my WordPress website to Azure. However, as I was looking through the pre-configured templates, I am quite confused and would be really thankful if someone can explain this for me. (Thank you in advance).
The template, which was created by WordPress for WordPress is using "App Service" model with a tier plan S1 (which comes with 100 total ACU & 1.75GB memory) and according to rough estimate it should be around 75 USD per month.
However, an alternative template created by Cloud Infrastructure Services is using a virtual machine model with a tier plan Standard_B1ms (which comes with 1 vcpu & 2 GiB memory) and according to rough estimate it should be around 36.83 USD per month.
I am quite struggling to understand the difference between the two options and more particular why one is using "App Service" and the other "Virtual Machine". In addition, what are the benefits and disadvantages to use one over the other. For example, when it comes to spikes in website traffic, the need to upgrade to higher tier, reliability, etc. Furthermore, I am not sure what 100 total ACU means. Is this supposed to be more powerful than the output that comes from a 1 core v-cpu? If yes, how much more? Last but not least, would like to hear your general opinion on hosting WordPress website on Azure, as well as, which of the two options would you go with and why? Thank you in advance!
ACU is a made-up measure for estimating the amount of computing power you receive. The ACU is a type of estimator since certain processors have turbo boost and some don't. DTUs for Azure SQL are similar, where DTU is a made-up statistic that combines IOPS, CPU, and RAM.
Azure App Service as "Build, deploy, and scale web apps on a fully managed platform". It's a Platform as a service and hence would be managed in the containers or any operating system can be used. Use the fully managed platform for your operating and monitoring activities to meet stringent, enterprise-grade performance, security, and compliance requirements.
Azure Virtual Machine It provides on-demand, high-scale, secure, virtualized infrastructure. It provides the flexibility of virtualization for a wide range of computing solutions, including development and testing, application execution, and datacenter expansion. It's the flexibility of open-source software set to your specifications.
Hence, Azure App service has lots of advantages as it has got tools with which it can be integrated. Scaling up is an ability using both the services and if you have an fix budget then you can opt Azure Virtual Machines then resize it anytime.
Here, is the Pricing Calculator which might help you to calculate the exact expenditure according the resources you choose.
I would definitely suggest to go for Azure App Service as it has a wide range of advantages.

Difference between Scale up and Scale out App Service plan

Actually I am getting System.OutOfMemoryException for blob trigger azure function.Do i need to scale up or Scale out App Service Plan to fix this problem.
What is the difference between these two?
For your original question, if your function is running on consumption plan, Scale up App Service Plan of your Azure service.The plan you already have less Memory and if you have multiple functions running in App Service Plan then scale out.
From the docs,
Scale up means :
A scale up operation is the Azure Web Sites cloud equivalent of moving
your non-cloud web site to a bigger physical server. So, scale up
operations are useful to consider when your site is hitting a quota,
signaling that you are outgrowing your existing mode or options. In
addition, scaling up can be done on virtually any site without
worrying about the implications of multi-instances data consistency.
Two examples of scale up operations in Windows Azure Web Sites are:
Scale Out means:
A scale out operation is the equivalent of creating multiple copies of
your web site and adding a load balancer to distribute the demand
between them. When you scale out a web site in Windows Azure Web Sites
there is no need to configure load balancing separately since this is
already provided by the platform.
Digram depicting the difference between the two :
You need to scale up your app service plan.
"Scale up" means upgrade the capacity of the host where the app is hosted. Ex: Increase the memory from 1.75GB to 3.5GB.
"Scale out" means upgrade the capacity of the app by increasing the number of host instances.
In Short Scale Up is vertical scaling, where you add more resources to increase capacity of the underlaying Hardware/Infrastructure.
Where, Scale Out is horizontal scaling, where you add more instance of the same app to process/handle request simultaneously.
If you choose Scale Out, you will get more VMs and balance your workloads to those VMs. If you choose Scale Up, your VM will get more punch to handle current workloads. More VMs or more power to your current VM

How long does it take for an Azure App Service instance to be available after a scale out?

Context: I am designing the auto-scaling (scale out) configuration for my .NET Framework 4.7 web app hosted on a Microsoft Azure App Service. I am using the P3V2 pricing tier. The application is CPU-bound. The app's 30 day CPU average is 30% usage while running on 2 instances, according to the stats indicated in the App Service plan. We occasionally have traffic spikes which will overwhelm the 2 instances: I want to implement auto-scaling.
I want to take into account the App Service Provisioning + App Startup Time when designing the metrics thresholds that decide when my app service scales out. I need to make my thresholds low enough to give Azure time to spin up a new app service instance but not so low that I am paying unnecessarily for processing power that's not needed. Budget is a significant factor.
Question: How long does it take for an Azure App Service instance to be available after a scale out? In other words, how long does it take for an Azure App Service to scale out?
P.S. I recognize that there is a lot more to scaling in/out that I am not addressing here. I'm trying my best to be succinct. :)
Generally, not long at all. By that I mean typically under one minute, but the time will vary depending on several factors, such as application size, time of day, region of deployment.
You could scale out manually and inspect the run history logs on the scale out tab.
FYI you can also use Azure Monitor to create auto-scale policies, in case this is of any use to you.

Resources