Skip to content

Commit a0fe086

Browse files
Apply suggestions from code review
Co-Authored-By: Craig Shoemaker <[email protected]>
1 parent 53e2022 commit a0fe086

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

articles/azure-functions/functions-consumption-costing.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ manager: gwallace
1212

1313
# Estimating Consumption plan costs
1414

15-
There are currently three types of hosting plans for app that run in Azure Functions, with each plan having its own pricing model:
15+
There are currently three types of hosting plans for an app that run in Azure Functions, with each plan having its own pricing model:
1616

1717
| Plan | Description |
1818
| ---- | ----------- |
@@ -28,9 +28,9 @@ This article deals only with the Consumption plan, since this plan results in va
2828

2929
The execution *cost* of a single function execution is measured in *GB-seconds*. Execution cost is calculated by combining its memory usage with its execution time. A function that runs for longer costs more, as does a function that consumes more memory.
3030

31-
Consider a case where the amount of memory used by the function stays constant. In this case, calculating the cost is simple multiplication. For example, say that your function consumed 0.5 GB for 3 seconds. Then the execution cost is just `0.5GB * 3s = 1.5 GB-seconds`.
31+
Consider a case where the amount of memory used by the function stays constant. In this case, calculating the cost is simple multiplication. For example, say that your function consumed 0.5 GB for 3 seconds. Then the execution cost is `0.5GB * 3s = 1.5 GB-seconds`.
3232

33-
Because memory usage changes over time, the calculation is essentially the integral of memory usage over time. The system does this calculation by sampling the memory usage of the process (along with child processes) at regular intervals. As mentioned on the [pricing page], memory usage is rounded up to the nearest 128-MB bucket. When your process is using 160 MB, you're charged for 256 MB. The calculation takes into account concurrency, which is multiple concurrent function executions in the same process.
33+
Since memory usage changes over time, the calculation is essentially the integral of memory usage over time. The system does this calculation by sampling the memory usage of the process (along with child processes) at regular intervals. As mentioned on the [pricing page], memory usage is rounded up to the nearest 128-MB bucket. When your process is using 160 MB, you're charged for 256 MB. The calculation takes into account concurrency, which is multiple concurrent function executions in the same process.
3434

3535
> [!NOTE]
3636
> While CPU usage isn't directly considered in execution cost, it can have an impact on the cost when it affects the execution time of the function.
@@ -39,7 +39,7 @@ To fix a lower bound on your estimates, it's useful to know the minimum costs of
3939

4040
## Other related costs
4141

42-
When estimating the overall cost of running your functions in any plan, remember that the Functions runtime uses several other Azure services, which are each billed separately. When pricing a Functions-base topology, any triggers and bindings you have that integrate with other Azure services require you to create and pay for those additional services.
42+
When estimating the overall cost of running your functions in any plan, remember that the Functions runtime uses several other Azure services, which are each billed separately. When calculating pricing for Functions apps, any triggers and bindings you have that integrate with other Azure services require you to create and pay for those additional services.
4343

4444
For functions running in a Consumption plan, the total cost is the execution cost of your functions, plus the cost of bandwidth and additional services.
4545

@@ -95,16 +95,18 @@ The resulting chart contains the totals for both execution metrics in the chosen
9595

9696
![Graph of function execution counts and execution units](media/functions-consumption-costing/monitor-metrics-execution-sum.png)
9797

98-
Because the number of execution units is so much greater than the execution count, the chart just shows execution units.
98+
As the number of execution units is so much greater than the execution count, the chart just shows execution units.
9999

100100
This chart shows a total of 1.11 billion `Function Execution Units` consumed in a two-hour period, measured in MB-milliseconds. To convert to GB-seconds, divide by 1,024,000. In this example, the function app consumed `1,110,000,000 / 1,024,000 = 1,083.98` GB-seconds. You can take this value and multiply by the current price of execution time on the [Functions pricing page][pricing page], which gives you the cost of these two hours, assuming you've already used any free grants of execution time.
101101

102102
### Azure CLI
103103

104-
The [Azure CLI](/cli/azure/) has commands for retrieving metrics. You can use the CLI from a local command environment or directly from the portal using [Azure Cloud Shell](../cloud-shell/overview.md). For example, the following [az monitor metrics list](/cli/azure/monitor/metrics#az-monitor-metrics-list) command returns hourly data over same time period used before:
104+
The [Azure CLI](/cli/azure/) has commands for retrieving metrics. You can use the CLI from a local command environment or directly from the portal using [Azure Cloud Shell](../cloud-shell/overview.md). For example, the following [az monitor metrics list](/cli/azure/monitor/metrics#az-monitor-metrics-list) command returns hourly data over same time period used before.
105+
106+
Make sure to replace `<AZURE_SUBSCRIPTON_ID>` with your Azure subscription ID running the command.
105107

106108
```azurecli-interactive
107-
az monitor metrics list --resource /subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX/resourceGroups/metrics-testing-consumption/providers/Microsoft.Web/sites/metrics-testing-consumption --metric FunctionExecutionUnits,FunctionExecutionCount --aggregation Total --interval PT1H --start-time 2019-09-11T21:46:00Z --end-time 2019-09-11T23:18:00Z
109+
az monitor metrics list --resource /subscriptions/<AZURE_SUBSCRIPTION_ID>/resourceGroups/metrics-testing-consumption/providers/Microsoft.Web/sites/metrics-testing-consumption --metric FunctionExecutionUnits,FunctionExecutionCount --aggregation Total --interval PT1H --start-time 2019-09-11T21:46:00Z --end-time 2019-09-11T23:18:00Z
108110
```
109111

110112
This command returns a JSON payload that looks like the following example:
@@ -236,4 +238,4 @@ customMetrics
236238
> [Learn more about Monitoring function apps](functions-monitoring.md)
237239
238240
[pricing page]:https://azure.microsoft.com/pricing/details/functions/
239-
[Azure portal]: https://portal.azure.com
241+
[Azure portal]: https://portal.azure.com

0 commit comments

Comments
 (0)