Explanation for CPU minutes/ day azure - azure

Will I be charged if I host my application on Azure App Service more than 60 min even if my app does not do any processing?

The answer is NO.
Under App Service -> App Service Plan -> Quotas you can see a detailed breakdown of usage such as an example below for a website I created hours ago but showing only 1.11 minutes of usage:
I got the answer from AjayKumar-MSFT's answer from this post at a Microsoft forum, then proceeded to test it myself.

You could go serverless with Azure Functions, host in a Consumption plan and only pay for execution time. It's a bit more complicated than that but in essence you don't pay for idle code, which i believe is what you're after.
https://azure.microsoft.com/en-us/pricing/details/functions/
Functions are billed based on observed resource consumption measured in gigabyte seconds (GB-s). Observed resource consumption is calculated by multiplying average memory size in gigabytes by the time in milliseconds it takes to execute the function. Memory used by a function is measured by rounding up to the nearest 128 MB, up to the maximum memory size of 1,536 MB, with execution time calculated by rounding up to the nearest 1 ms. The minimum execution time and memory for a single function execution is 100 ms and 128 mb respectively. Functions pricing includes a monthly free grant of 400,000 GB-s.
A very detailed example is found under that URL.

My answer is NO. if CPU time exceeds no charge will cost rather site will be stopped and it will be working after a certain time next day. Under App Service -> App Service Plan -> Quotas you can get details of CPU time and memory. It is clearly mentioned in Quotas that Applications hosted in a free or shared App Service plan are subject to usage quotas. If any quota is exceeded the site will be stopped until that quota resets. You can remove quotas on your app by scaling up your App Service Plan.

The costs depend on the pricing plan you choose for your app. There are several plans available to choose from. You could choose the Free plan and you won't incur costs but this plan is mostly meant for experimenting with the platform. It doesn't provide any SLA.
You can find more details about the pricing at the following links
App Service pricing
App Service Plans
And yes, your app will incur costs even if it is not consuming any CPU since it is allocated resource (a VM) and is running.

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.

Azure FunctionApps vs Azure App Services for Compute intensive work

I have 2 questions first related to hosting, second related to sdk/library to use:
I need to write a kind of work allocation service scheduler to people, which will run say every 1 hour to run compute intensive logic in background and push the results in our database. The input may be number of days to create schedule for, number of people available, count of tasks to be done. So primarily its compute intensive.
Should i host it in App Service or in Azure Function (TimerTrigger)? This scheduler run as total background job and never called from UI or any backend API.
If i go App service way i have choice of either Hangfire or WebJob. How should i decide which is good for me.
Certainly quick execution with lesser cost is my criteia to move ahead.
One consideration for Azure function is how long the processing will take. Azure functions have a maximum time limit that depends on hosting plan. When you create a function app in Azure, you must choose a hosting plan for your app. There are three hosting plans available for Azure Functions: Consumption plan, Premium plan, and Dedicated (App Service) plan. An overview of hosting plans and their timeout durations is here: Azure Functions scale and hosting.
Unlimited duration is in Premium plan or Dedicated plan (Unlimited execution duration - 60 minutes guaranteed).
Maximum duration for Consumption plan is 10 minutes.

Azure Speech: Usage reporting on free plan (F0)

I have deployed a Speech resource (cognitive services) on Azure using the F0 plan (free tier). The free tier gives up to 5 hours per month.
How can I check the current usage, letting me know how many minutes/hours have been spent already this month?
Looks like you can see your free usage via the subscriptions page by following the instructions here:
https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/check-free-service-usage
I guess the only solution is to check on Cost Analysis on Azure Portal, then filter on your resource:
https://portal.azure.com/#blade/Microsoft_Azure_CostManagement/Menu/costanalysis
But you will not get the item by minutes, but by price, then you can convert given the cost / minute. There might also be a delay between your real consumption and the impact on cost analysis.

Microsoft Azure WebApp Deployment Plan

Need help on below points:
Data out limit for free tier is 165 MB. How is data out usage calculated?
I am using a free tier subscription type. Why does Memory usage increase as soon as memory resets after 1 hour? Why does my application take 230-240 MB of memory initially?
I have a free tier account with credit amount xxx Rs. Can I use the free tier amount for another subscription like basic or standard?
Are there any data out and memory usage limit for other subscriptions like basic/Premium/standard?
Outgoing traffic
Its the memory taken by the IIS instance, thats expected in Azure
I don't understand, but you can use money from your subscription and you cannot use Tiers together, so pay for a free tier, but get all the benefits of a Premium Tier.
You can take a look at the limits on the pricing page.

Azure App Service - CPU Percentage of instance vs plan

I am running a load test against my Azure Web App P3 pricing tier. We have the following auto scale out strategy -
Min Instance 5 and Max instance 20, Increase by 1 Instance if CPU Percentage (Max) goes more than 85%, Decrease by 1 Instance if CPU Percentage Average goes below than 50%
Right now, it is running with 5 instances. If I go to Applications Insights, 'Live Metrics Stream' pane of all available instances, it shows that CPU usage is around 75% (average) in all the 5 instances. In fact, some of the instances are nearing 85%.
Whereas, if I turn to CPU usage chart on the App Service Plan level (I have only one app running under the plan), it shows only 20%.
How do we reconcile these two conflicting stats?
What is shown in 'Live Metrics Stream' is the CPU usage of w3wp process, whereas what is shown in App Service Plan level is the total Machine CPU usage. The former is not normalized for take into account the number of logical processors - so you need to divide it by number of cores to get the normalized percentage.
Even after this, 'Live Metrics Stream' metric can be lower than AppServicePlan metric as the former only shows w3wp usage and the latter shows total machine cpu usage.
According to your description, I tried to run the load test against my Azure Web App. Here are the detailed metrics from Application Insights and App Service Plan, you could refer to it.
Application Insight > Metrics Explorer
Time range within an hour
PROCESS CPU: The percentage of elapsed time of all process threads used by the processor to execute the applications process.This metric is an average. Each point on the chart represents 1 minute of data.
App Service Plan > Monitoring
CPU percentage on the other hand is useful for apps hosted in basic, standard and premium plans since they can be scaled out and this metric is a good indication of the overall usage across all instances.
Note: Since the Live Metrics Stream provides you the metrics within the latest 60 seconds. Please try to compare the metrics from App Service Plan and Application Insights within the same Time range.
Per my understanding, the trend of metrics from Service Plan and Application Insights is approximately the same. For auto-scaling, I assumed that you'd better refer to the metrics from the App Service Plan level. Here is a screenshot about the history metrics when you adding the rule for auto-scaling, which matches the metrics from "App Service Plan > Monitoring" with the same time range.
Metrics when adding the scale rule:
App Service Plan > Monitoring

Resources