Azure Functions - 限制并行执行

标签 azure azure-functions

是否可以限制并行运行的函数的最大数量?

我阅读了文档并发现了这一点:

When multiple triggering events occur faster than a single-threaded function runtime can process them, the runtime may invoke the function multiple times in parallel.

If a function app is using the Consumption hosting plan, the function app could scale out automatically. Each instance of the function app, whether the app runs on the Consumption hosting plan or a regular App Service hosting plan, might process concurrent function invocations in parallel using multiple threads.

The maximum number of concurrent function invocations in each function app instance varies based on the type of trigger being used as well as the resources used by other functions within the function app.

https://learn.microsoft.com/en-gb/azure/azure-functions/functions-reference#parallel-execution

我在具有事件中心输入绑定(bind)的应用服务计划上使用函数,并且我的函数应用程序中只有一个函数。如果我不能限制它,有谁知道这种设置的并发函数调用的最大数量是多少?

最佳答案

无法指定事件中心触发函数的最大并发数,但您可以控制批量大小和获取选项,如 described here .

并发调用的最大数量也可能会有所不同,具体取决于您的工作负载和资源利用率。

如果需要并发限制,这是(当前)您需要处理的事情,以下帖子讨论了您可能会发现有用的一些模式:

Throttling Azure Storage Queue processing in Azure Function App

Limiting the number of concurrent jobs on Azure Functions queue

关于Azure Functions - 限制并行执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44257660/

相关文章:

c# - 小 Sprite 宇宙 : How to copy a property value of edge as vertex property inside a repeat command

azure - 尝试在 azure 上部署示例 Web 应用程序时出现问题

azure - 使用 asp.net 核心和 Azure 运行 .exe

c# - 如何根据范围查询结果删除Azure表实体

azure - 使用托管服务标识从数据工厂调用 Azure Function

Azure CLI 部署功能,非 fatal error

java - 从azure sdk for java生成jar时出错

azure - 在 azure 上部署 Microsoft 企业机器人模板时出现错误

c# - Azure 函数应用计费、成本和性能取决于函数数量

multithreading - Azure 函数的多个输入