Azure Function Apps的资源消耗似乎高了一百万倍,忽略了最大使用配额

标签 azure azure-functions azureportal

我们的函数应用程序中的所有函数似乎都报告了异常高的资源消耗。来自 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

(我知道它也是按每百万次执行定价的,但我正在研究这里的单次执行)。

我的函数的“监视器” Blade 显示上次执行的持续时间为 47659 毫秒,即 47.659 秒。 “内存工作集”指标表明我的函数在峰值时使用了 117MB,因此将其四舍五入为 128MB,并且我的函数的资源消耗应该为:

0.128GB * 47.659s = 6.1GB-s。

问题是,对于该执行,“函数执行单元”指标显示它实际使用了 594 万(百万)GB-s。我很确定 M = Million,因为早期的一些小函数有一个“k”后缀而不是 M(该函数当时无法启动,只运行了大约 100 毫秒)。

我还将每日执行配额设置为 13,333,因此整个函数应用程序当天应该立即停止,但事实并非如此,并且其他函数之一在几分钟后执行。附上一张屏幕截图,其中显示了所讨论的执行情况以及另一个执行情况。我已经要求这里的其他人登录并查看,每个人在所有功能应用程序上都看到同样的东西。

我在这里缺少什么?

enter image description here

编辑:指标 API 显示了同样的奇怪之处 - 运行 591 毫秒的函数执行返回以下内容:

az 监视器指标列表 --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 中和/或在功能定价文档中提及,就会更加清晰。但我的错是没有 RTFM...

关于Azure Function Apps的资源消耗似乎高了一百万倍,忽略了最大使用配额,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62747484/

相关文章:

git - Azure网站创建给出 "Access denied"

node.js - 为什么这个Azure时间触发功能不会失败?

node.js - Azure Functions NodeJS Express 应用程序抛出无法确定函数入口点错误

mongodb - Azure 文档数据库 |设置中缺少连接字符串

Azure 门户 : How to restrict IP address access to app deployed in an Azure virtual machine?

azure - DocumentDB - 删除导致 401 错误

尝试使用地址栏或刷新页面访问时,Azure Web应用程序返回404

c# - 将 VM 物理路径映射到 azure blob 存储

azure - 如何在 Azure Function App 中配置队列触发器的队列名称

azure - 权限不足,无法激活 "security defaults"中的 "Azure Active Directory"选项