FanOutFanIn

The one setting that can kill your Durable Functions’ parallelization

Durable Functions are amazing when it comes to executing complicated orchestrations. Especially when you have heavy-load deterministic tasks, than Fan-Out/Fan-In (featured image) patterns comes in handy.

Now as you know, 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.

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

setting in host.json

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 10000 activity functions you just unleashed! Not good! At least if you’re looking for high performance.

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

It sky rocketed

This website uses cookies. By continuing to use this site, you accept our use of cookies.