Featured image of post The one setting that can kill your Durable Functions’ parallelization

The one setting that can kill your Durable Functions’ parallelization

Azure will scale out for you (assuming you’re in the correct tier), spreading your activity functions over multiple instances. However, initiating new instances takes time, and Azure will not do that unless the current workload exceeds the current instance’s capacity, which is fine—we appreciate the cost-savings.

The maxConcurrentActivityFunctions Setting

Luckily, you are allowed to configure the maximum amount of concurrent activity functions per worker using the maxConcurrentActivityFunctions setting in host.json.

1
2
3
4
5
"extensions": { 
    "durableTask": { 
        "maxConcurrentActivityFunctions": 10 
    } 
} 

Be aware though, setting this to a high number will result in this:

It back-fired

Azure will accommodate and exhaust that one single worker, making room for all the 10,000 activity functions you just unleashed! Not good! At least if you’re looking for high performance.

The Solution

What you need to do is set a realistic number of concurrent activity functions so that Azure distributes evenly and before the workload becomes unbearable. It should look like this:

It sky rocketed

By carefully tuning this setting, you can ensure optimal performance and avoid overloading a single worker.

All rights reserved
Built with Hugo
Theme Stack designed by Jimmy