Azure Functions - Limiting parallel execution

后端 未结 3 1370
清酒与你
清酒与你 2021-01-01 09:47

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

I read the documentation and came across this:

When multiple trigger

相关标签:
3条回答
  • 2021-01-01 10:33

    Just for reference, I came across here in my search for throttling. You can use the [Singleton] attribute on your function ensuring only one-at-a-time execution. Maybe not really what you were looking for and a very rigorous way of throttling, but still, it is an option.

    https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to#singleton-attribute

    0 讨论(0)
  • 2021-01-01 10:38

    Microsoft has added a new setting which can be used to limit concurrency of function execution. The setting is WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT and can be used to limit how many function instances will execute in parallel. However, according to Microsoft, it isn't fully implemented yet.

    https://github.com/Azure/azure-functions-host/wiki/Configuration-Settings

    0 讨论(0)
  • 2021-01-01 10:49

    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:

    Throttling Azure Storage Queue processing in Azure Function App

    Limiting the number of concurrent jobs on Azure Functions queue

    0 讨论(0)
提交回复
热议问题