简体   繁体   中英

Azure Function workers vs instances

I'm currently using an Azure Premium Service App (P3v3). I found that my function needs some boost, so I decided to look at how I can configure scaling. I found two available options:

  1. Set FUNCTIONS_WORKER_PROCESS_COUNT in the configuration section
  2. Configure the number of instances in Scale-Out menu

But what is the difference between instances and workers? Haven't found any information about that or how it can affect costs.

what is the difference between instances (Scale-Out menu) and workers ( FUNCTIONS_WORKER_PROCESS_COUNT ) ?

These are Microsoft Documentations to understand Workers and Instances in terms of Cost Management (Billing) and Functionality:

MSFT Sources of FUNCTIONS_WORKER_PROCESS_COUNT :

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

MSFT Sources of Azure Functions Premium Plan Scale-Out Instances :

  1. Azure Functions Hosting options Information
  2. Azure Functions Premium Plan Instances Billing

AFAIK, FUNCTIONS_WORKER_PROCESS_COUNT limits the max no. of worker processes per Function host instance. These instances are kind of separate VMs where the FUNCTIONS_WORKER_PROCESS_COUNT limit is applied to each of them individually.

For example, If the FUNCTIONS_WORKER_PROCESS_COUNT is set to 10, it means 10 Individual Functions concurrently run by each host instance.

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 .


how it can affect costs.

As this Microsoft Azure Services Pricing Calculator Says, you'll be charged per instance when you scale-out.

P3v3定价计算器

When it comes to Cost Management , the incremental nature of the Scale-Out methodology is extremely beneficial .

Cost increases should be somewhat predictable because the components are identical.

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

In most cases, services can be quickly added or deleted to satisfy resource requirements. By just using (and paying for) the resources required at the time, this flexibility and speed effectively minimize spending.

Refer to this article for more information on cost management and the benefits of Scale-Up and Scale-out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM