azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

What are the defaults values of "maxConcurrentActivityFunctions" and "maxConcurrentOrchestratorFunctions"?

Open GP4cK opened this issue 1 year ago • 3 comments

What are the defaults values of maxConcurrentActivityFunctions and maxConcurrentOrchestratorFunctions?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

GP4cK avatar Feb 10 '23 02:02 GP4cK

@GP4cK Thanks for your feedback! We will investigate and update as appropriate.

Naveenommi-MSFT avatar Feb 10 '23 03:02 Naveenommi-MSFT

@GP4cK I have got the confirmation from my team that the maximum value for the maxConcurrency parameters (by maxConcurrentActivityFunctions and maxConcurrentOrchestratorFunctions is Int32.MaxValue which is 2147483647.

If you set the limit that high, in practice that just means that you want “no limit” (because concurrency will never even get near to that number).

MayankBargali-MSFT avatar Feb 14 '23 16:02 MayankBargali-MSFT

@MayankBargali-MSFT thanks but I'm asking for the default values.

If I don't specify maxConcurrentActivityFunctions or maxConcurrentOrchestratorFunctions in my host.json and I use the fan out / fan in pattern with 100 activities for example, how many activities will run concurrently?

GP4cK avatar Feb 14 '23 23:02 GP4cK

@GP4cK The maxConcurrentOrchestratorsDefault is 5 or 10 * Environment process count and maxConcurrentActivitiesDefault is 10 or 10 * Environment processor count

The max number of activities that run concurrently in a function app is then (number of worker nodes) * (maxConcurrentActivitiesDefault) So, this number depends on the scale out (because the limit is applied per worker node).

When considering the value to use for maxConcurrentActivitiesDefault, the main consideration is usually the local resources a function requires to run, like memory or CPU. Setting this limit low can help to avoid running out of memory or oversubscribing the CPU (because it prevents running too many of these functions on a single node and instead distributes them over more nodes). However, some activities consume almost no resources to speak of (e.g. an async call to an external service), so for those situations setting it to 100 or higher is no problem and can speed up your app.

We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

MayankBargali-MSFT avatar Feb 20 '23 12:02 MayankBargali-MSFT