Azure Function Apps 的资源消耗似乎高出一百万倍,忽略了最大使用配额
Azure Function Apps' resource consumption seems a million times too high, ignores max usage quota
我们的函数应用程序中的所有函数似乎都报告了异常高的资源消耗。来自 docs:
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
(我知道它也是按每百万次执行定价,但我正在调查这里的单次执行)。
我的函数的“监控”边栏选项卡显示最后一次执行的持续时间为 47659 毫秒,即 47.659 秒。 “内存工作集”指标表明我的函数在其峰值时使用 117MB,因此将其四舍五入为 128MB,并且我的函数的资源消耗 应该 是:
0.128GB * 47.659s = 6.1 GB-s。
问题是,对于该执行,“函数执行单元”指标显示它实际使用了 594 万(百万)GB-s。我很确定 M = Million 因为之前一些小的有一个“k”后缀而不是 M(函数当时无法启动,只有 运行 约 100 毫秒)。
我还将每日执行配额设置为 13,333,因此整个 Function App 应该在当天立即停止,但它没有,其他功能之一在几分钟后执行。附件是一个屏幕截图,其中显示了有问题的执行以及另一个执行。我问过这里的其他人登录并查看,每个人都看到了同样的东西,在所有功能应用程序上。
我在这里错过了什么?
编辑:指标 API 显示了同样的怪异 - 一个运行了 591 毫秒的函数执行 returns 这个:
az monitor metrics list --resource 'func-name' --resource-group 'rg-name' --resource-type 'Microsoft.Web/sites' --metrics 'FunctionExecutionUnits'
{
"average": null,
"count": null,
"maximum": null,
"minimum": null,
"timeStamp": "2020-07-06T06:55:00+00:00",
"total": 120064.0
}
终于在另一个文档页面 Estimating Consumption plan costs 上找到了一些清晰的信息,在“查看执行数据”部分的底部有一个关于如何生成函数执行单元图表的示例,在他们的示例下面图表,它简要提到以下内容:
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 1024000.
如果单位显示在功能定价文档中提到的 Azure Monitor and/or 中,会更清楚。但我的错不是 RTFM...
我们的函数应用程序中的所有函数似乎都报告了异常高的资源消耗。来自 docs:
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
(我知道它也是按每百万次执行定价,但我正在调查这里的单次执行)。
我的函数的“监控”边栏选项卡显示最后一次执行的持续时间为 47659 毫秒,即 47.659 秒。 “内存工作集”指标表明我的函数在其峰值时使用 117MB,因此将其四舍五入为 128MB,并且我的函数的资源消耗 应该 是:
0.128GB * 47.659s = 6.1 GB-s。
问题是,对于该执行,“函数执行单元”指标显示它实际使用了 594 万(百万)GB-s。我很确定 M = Million 因为之前一些小的有一个“k”后缀而不是 M(函数当时无法启动,只有 运行 约 100 毫秒)。
我还将每日执行配额设置为 13,333,因此整个 Function App 应该在当天立即停止,但它没有,其他功能之一在几分钟后执行。附件是一个屏幕截图,其中显示了有问题的执行以及另一个执行。我问过这里的其他人登录并查看,每个人都看到了同样的东西,在所有功能应用程序上。
我在这里错过了什么?
编辑:指标 API 显示了同样的怪异 - 一个运行了 591 毫秒的函数执行 returns 这个:
az monitor metrics list --resource 'func-name' --resource-group 'rg-name' --resource-type 'Microsoft.Web/sites' --metrics 'FunctionExecutionUnits'
{
"average": null,
"count": null,
"maximum": null,
"minimum": null,
"timeStamp": "2020-07-06T06:55:00+00:00",
"total": 120064.0
}
终于在另一个文档页面 Estimating Consumption plan costs 上找到了一些清晰的信息,在“查看执行数据”部分的底部有一个关于如何生成函数执行单元图表的示例,在他们的示例下面图表,它简要提到以下内容:
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 1024000.
如果单位显示在功能定价文档中提到的 Azure Monitor and/or 中,会更清楚。但我的错不是 RTFM...