简体   繁体   English

Is the 1.5 GB memory limit in Azure Functions limited to the entire Function App or per function invocation?

[英]Is the 1.5 GB memory limit in Azure Functions limited to the entire Function App or per function invocation?

I'm setting up an Azure Function app that has multiple timer triggers that are triggered at or around the same time.我正在设置一个 Azure Function 应用程序,该应用程序具有多个同时或大约同时触发的计时器触发器。 I'm confused by the wording here: https://docs.microsoft.com/fi-fi/azure/azure-functions/functions-scale我对这里的措辞感到困惑: https://docs.microsoft.com/fi-fi/azure/azure-functions/functions-scale

Each instance of the Functions host in the Consumption plan is limited to 1.5 GB of memory and one CPU.消费计划中的 Functions 主机的每个实例限制为 1.5 GB 的 memory 和一个 CPU。 An instance of the host is the entire function app, meaning all functions within a function app share resource within an instance and scale at the same time.主机的一个实例是整个 function 应用程序,这意味着 function 应用程序中的所有功能在一个实例内共享资源并同时扩展。

Does that mean that each script that is executed with a timer trigger is allocated 1.5 GB of memory or does that mean that all of the scripts share 1.5 GB of memory that are running at the same time?这是否意味着每个使用计时器触发器执行的脚本都分配了 1.5 GB 的 memory,或者这是否意味着所有脚本共享 1.5 GB 的 memory 同时运行?

Plan is a virtual concept, it is basically based on virtual machines.计划是一个虚拟的概念,它基本上是基于虚拟机的。 plan provides the scale of computing resources that you can deploy.计划提供您可以部署的计算资源的规模。 When you deploy an application or function on a plan, it will use a portion of the computing resources, and the total computing resources that you can deploy are based on how many computing resources the plan you choose provides.当您在计划上部署应用程序或 function 时,它将使用一部分计算资源,您可以部署的总计算资源取决于您选择的计划提供多少计算资源。 If you want more computing resources or memory, please choose premium plan or App Service Plan.如果您需要更多计算资源或 memory,请选择高级计划或应用服务计划。

The premium plan provides three pricing tiers: https://docs.microsoft.com/fi-fi/azure/azure-functions/functions-premium-plan#available-instance-skus If you choose App Service Plan, you have more options高级计划提供三个定价层: https://docs.microsoft.com/fi-fi/azure/azure-functions/functions-premium-plan#available-instance-skus如果您选择应用服务计划,您有更多选择

This is obviously impossible for each trigger to have 1.5gb of memory.这显然不可能每个触发器都有 1.5gb 的 memory。 It means that your function app can use 1.5gb.这意味着您的 function 应用程序可以使用 1.5gb。 If you need more memory, you need to choose premium plan or app service plan and select the corresponding pricing tier.如果您需要更多 memory,您需要选择高级计划或应用服务计划和 select 相应的定价层。

The way it is documented for Consumption Plan is a bit confusing.为消费计划记录的方式有点令人困惑。 I ran a small test that would fill memory 10MB every min till 1GB.我运行了一个小测试,每分钟填充 memory 10MB 直到 1GB。

Here is the result of 3 instances running at same time: https://www.screencast.com/t/F3rTyZWk以下是 3 个实例同时运行的结果: https://www.screencast.com/t/F3rTyZWk

So when in azure documentation they say 1.5GB per instance, it is actually per instance and not for all the instance of the Function App.因此,当在 azure 文档中他们说每个实例 1.5GB 时,它实际上是每个实例,而不是 Function 应用程序的所有实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM