You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-concurrency.md
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ms.author: cachai
12
12
This article describes the concurrency behaviors of event-driven triggers in Azure Functions. It also describes a new dynamic model for optimizing concurrency behaviors.
13
13
14
14
>[!NOTE]
15
-
>The dynamic concurrency model is currently in preview. Support for dynamic concurrency is limited to specific binding extensions, which are also in preview.
15
+
>The dynamic concurrency model is currently in preview. Support for dynamic concurrency is limited to specific binding extensions.
16
16
17
17
The hosting model for Functions allows multiple function invocations to run concurrently on a single compute instance. For example, consider a case where you have three different functions in your function app, which is scaled out and running on multiple instances. In this scenario, each function processes invocations on each VM instance on which your function app is running. The function invocations on a single instance share the same VM compute resources, such as memory, CPU, and connections. When your app is hosted in a dynamic plan (Consumption or Premium), the platform scales the number of function app instances up or down based on the number of incoming events. To learn more, see [Event Driven Scaling](./Event-Driven-Scaling.md)). When you host your functions in a Dedicated (App Service) plan, you manually configure your instances or [set up an autoscale scheme](dedicated-plan.md#scaling).
18
18
@@ -33,7 +33,7 @@ Ideally, we want the system to allow instances to process as much work as they c
33
33
Functions now provides a dynamic concurrency model that simplifies configuring concurrency for all function apps running in the same plan.
34
34
35
35
> [!NOTE]
36
-
> Dynamic concurrency is currently only supported for the Service Bus trigger and requires you to use [version 5.0.0-beta.6 (or higher)](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/5.0.0-beta.6) of the **Microsoft.Azure.WebJobs.Extensions.ServiceBus**extension.
36
+
> Dynamic concurrency is currently only supported for the Azure Blob, Azure Queue, and Service Bus triggers and requires you to use the versions listed in the [extension support section below](#extension-support).
37
37
38
38
### Benefits
39
39
@@ -74,7 +74,20 @@ When dynamic concurrency is enabled, you'll see dynamic concurrency decisions in
74
74
75
75
### Extension support
76
76
77
-
Dynamic concurrency is enabled for a function app at the host level, and any extensions that support dynamic concurrency run in that mode. Dynamic concurrency requires collaboration between the host and individual trigger extensions. For preview, only the latest (preview) versions of the following extensions support dynamic concurrency.
77
+
Dynamic concurrency is enabled for a function app at the host level, and any extensions that support dynamic concurrency run in that mode. Dynamic concurrency requires collaboration between the host and individual trigger extensions. For preview, only the listed versions of the following extensions support dynamic concurrency.
78
+
79
+
#### Azure Queues
80
+
81
+
The Azure Queue storage trigger has its own message polling loop. When using static config, concurrency is governed by the `BatchSize`/`NewBatchThreshold` config options. When using dynamic concurrency, those configuration values are ignored. Dynamic concurrency is integrated into the message loop, so the number of messages fetched per iteration are dynamically adjusted. When throttles are enabled (host is overloaded), message processing will be paused until throttles are disabled. When throttles are disabled, concurrency will increase.
82
+
83
+
To use dynamic concurrency for Queues, you must use [version 5.x](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage) of the storage extension.
84
+
85
+
#### Azure Blobs
86
+
87
+
Internally, the Azure Blob storage trigger uses the same infrastructure that the Azure Queue Trigger uses. When new/updated blobs need to be processed, messages are written to a platform managed control queue, and that queue is processed using the same logic used for QueueTrigger. When dynamic concurrency is enabled, concurrency for the processing of that control queue will be dynamically managed.
88
+
89
+
To use dynamic concurrency for Blobs, you must use [version 5.x](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage) of the storage extension.
90
+
78
91
79
92
#### Service Bus
80
93
@@ -84,12 +97,12 @@ The Service Bus trigger currently supports three execution models. Dynamic concu
84
97
-**Session based single dispatch topic/queue processing**: Each invocation of your function processes a single message. Depending on the number of active sessions for your topic/queue, each instance leases one or more sessions. Messages in each session are processed serially, to guarantee ordering in a session. When not using dynamic concurrency, concurrency is governed by the `MaxConcurrentSessions` setting. With dynamic concurrency enabled, `MaxConcurrentSessions` is ignored and the number of sessions each instance is processing is dynamically adjusted.
85
98
-**Batch processing**: Each invocation of your function processes a batch of messages, governed by the `MaxMessageCount` setting. Because batch invocations are serial, concurrency for your batch-triggered function is always one and dynamic concurrency doesn't apply.
86
99
87
-
To enable your Service Bus trigger to use dynamic concurrency, you must use [version 5.0.0-beta.6 (or higher)](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/5.0.0-beta.6) of the **Microsoft.Azure.WebJobs.Extensions.ServiceBus** extension.
100
+
To enable your Service Bus trigger to use dynamic concurrency, you must use [version 5.x](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus) of the Service Bus extension.
88
101
89
102
## Next steps
90
103
91
104
For more information, see the following resources:
92
105
93
106
*[Best practices for Azure Functions](functions-best-practices.md)
0 commit comments