Home > Back-end >  Azure Functions Elastic Premium Plan and Queue Triggers
Azure Functions Elastic Premium Plan and Queue Triggers

Time:05-04

We have a solution where we use an Azure Storage Queue to process messages that take approx 6 minutes.

I've read that the maximum batchSize of Queue messages concurrently processed are 32 per VM.

If the function app scales out to multiple VMs, each VM could run one instance of each queue-triggered function.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue?tabs=in-process,extensionv5,extensionv3&pivots=programming-language-csharp#host-json

How does that translate to Azure Functions Premium plan? Lets say we want to be able to process 64 messages at once using Azure Functions Premium plan with Always ready instances. If we have 2 ready instances, can they process 2 * 32 concurrent messages? Or do they underwater really need to be on seperate VM's and 2 instances will not do anything different?

In the Premium plan, you can have your app always ready on a specified number of instances. The maximum number of always ready instances is 20. When events begin to trigger the app, they are first routed to the always ready instances.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan?tabs=portal#always-ready-instances

CodePudding user response:

Yes. In Azure Functions premium plan, if you have pre-warmed instance, then that is given a dedicated VM instance. So, if you had 2 VM instances running your function app, then they can process 2*(batchSize newBatchThreshold) concurrent Queue messages! The Azure platform scales the function app onto new VM as the existing instances gets more busy.

  • Related