Azure功能-限制并行执行 [英] Azure Functions - Limiting parallel execution

查看:88
本文介绍了Azure功能-限制并行执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is it possible to limit the maximum number of Functions that run in parallel?

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

I read the documentation and came across this:

当多个触发事件发生的速度快于单线程函数运行时对其进行处理的速度时,运行时可能会并行调用该函数多次.

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.

如果功能应用程序正在使用消费"托管计划,则该功能应用程序可能会自动向外扩展.功能应用程序的每个实例,无论该应用程序是在消费"托管计划上运行还是在常规App Service托管计划上运行,都可以使用多个线程并行处理并发功能调用.

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://docs.microsoft. com/en-gb/azure/azure-functions/functions-reference#parallel-execution

我在带事件中心输入绑定的App Service计划上使用功能,并且在我的功能应用程序中只有一个功能.如果我不能限制它,那么有人知道这种设置的最大并发函数调用次数是多少吗?

I am using a Function on an App Service plan with an Event Hub input binding and only have a single Function within my Function App. If I can't limit it, does anyone know what the maximum number of concurrent function invocations will be for this kind of setup?

推荐答案

无法为Event Hubs触发的函数指定最大并发性,但是您可以将批量大小和获取选项控制为

There isn't a way to specify a maximum concurrency for Event Hubs triggered functions, but you can control batch size and fetching options as described here.

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

The maximum number of concurrent invocations may also vary depending on your workload and resource utilization.

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

If concurrency limits are needed, this is (currently) something you'd need to handle, and the following posts discuss some patterns you may find useful:

在Azure Function应用程序中限制Azure存储队列处理

限制Azure Functions上的并发作业数队列

这篇关于Azure功能-限制并行执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆