0

Azure Function architecture: Function architecture

So we are setting a pipeline in Azure Datafactory, it contains 4 triggers to trigging Function1 at the same time with 4 different parameters.

Pipeline -> Function1-param1 Function1-param2 Function1-param3 Function1-param4

Yesterday, I tried to trigger that pipeline 2 times in 5 minutes, e.g. 10:30 and 10:31. That means, that time I tiggered Function1 for 8 times in 5 minutes.

Pipeline ->

time 1 Function1-param1 Function1-param2 Function1-param3 Function1-param4 10:30

time 2 Function1-param1 Function1-param2 Function1-param3 Function1-param4 10:31

Strange thing is that, we expect 8 calls running parallel cause FUNCTION_WORKER_PROCESS_COUNT is setting to 10, but there are only 6 calls running parallel, 2 are running after that.

So the question is, what is the relationship between FUNCTION_WORKER_PROCESS_COUNT and the tasks that can running parallel.

Function is written in Powershell 7.

parallelbgls
  • 143
  • 1
  • 7

1 Answers1

0

AFAIK, the maximum number of worker processes per Function host instance is limited by the FUNCTIONS WORKER PROCESS COUNT variable. These instances are treated as independent VMs, with the FUNCTIONS WORKER PROCESS COUNT limit applied to each one.

If the FUNCTIONS WORKER PROCESS COUNT is set to 10, each host instance will perform 10 individual functions at the same time.

Multiple Workers means Multiple Process Ids of the Same Function App which is a logical collection of Functions.

One Worker Process can host all functions of one Function App where the Single Host has the default value as 1 to the FUNCTIONS_WORKER_PROCESS_COUNT and the Function Host means it is the Physical/Virtual Host where Function App runs as Windows/Linux Process.

Refer here for more information on mechanism of FUNCTIONS_WORKER_PROCESS_COUNT.

Scaling out also allows you to adapt to changes in demand more quickly.

To meet resource requirements, services may usually be swiftly added or removed. This flexibility and quickness efficiently saves spending by only using (and paying for) the resources required at the moment.

Refer this article for more information on the benefits of Scale Up and Scale out.

References of more information on FUNCTIONS_WORKER_PROCESS_COUNT:

  1. Azure Functions - Functions App Settings - functions_worker_process_count
  2. Azure Functions - Best Practices - FUNCTIONS_WORKER_PROCESS_COUNT