Durable Functions Scaling Not Woking

Mark Barge 6 Reputation points

I have have set up a consumption (serverless) based function plan in which I have installed a durable function. The process calls an activity function which is used to calculate a large set of mathematical equations and writes the result to data matrices.

I notice that when called, the activity is allocated 2 CPUs. Given the intensity of the calculations I need a separate VM to be allocated to it for each call so I configured the host file with the following.

"durableTask": {
    "maxConcurrentActivityFunctions": 1,
    "maxConcurrentOrchestratorFunctions": 1

But it doesn't appear to be working. If I make a single call it takes 1 min. If I make 5 concurrent calls they take 4 minutes each.

With this configuration I expected each call to be allocated its own VM and 2 CPUs and should each take just 1 minute, but that clearly is not happening.

I'm likely to end up with 1000s of concurrent calls and clearly at the moment that would be impossible.

Can anyone please explain what is happening here and why it's not working? Also is there a way to monitor how many VM have been allocated to the Durable Function as a whole?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,000 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 14,971 Reputation points Microsoft Employee

    @Mark Barge The setting that you are using controls the number of activity/orchestration functions per instance and in the case of concurrent requests, should scale out to multiple instances based on the events (in this case queue messages from durable functions). This should happen once every 30 seconds and is decided by the scale controller as mentioned in the docs in a way unique to each trigger type.

    So, if you have the single activity function taking up all resources, the scale controller should scale out your function app during this cycle, but not directly on calling an activity function. To understand more about the scale controller decisions, you can enable scale controller logs.

    To improve scale out, you could switch to using the Premium Plan which along with faster scaling offers higher CPU count per instance.