Share via

Azure functions activity trigger calls not running concurrently

Yugal 0 Reputation points
2024-01-09T13:15:08.35+00:00

I am giving multiple calls to the Azure activity function from a durable function.

The multiple calls are done and appended to a list and later all calls are fetched using yield to context.task_all

I have the below observations:

  • I ran the same code on my local environment and used a print statement to get the time of each call. The activity functions are running concurrently in the local environment.
  • When the same code is deployed to the test environment and monitored then found that activity function calls are not running concurrently.

For resolving, I tried multiple ways but none of them seems to work. Below are a few steps taken.

  • Use the async keyword while defining activity function but still, the code flow is not concurrent.
  • Updated host.json

The host.json contains the below section already in my case

"concurrency": {
    "dynamicConcurrencyEnabled": true,
    "snapshotPersistenceEnabled": true
  }

I added maxConcurrentActivityFunction

"durableTask": {
      "maxConcurrentActivityFunctions":4
    }

maxConcurrentActivityFunction impacted the concurrency flow on my local environment but again no impact on the test environment.

Please help me identify the reason for this behavior and the steps I can take to make sure my activity function calls run concurrently even for a few calls or a large number of calls.

Thanks in advance!!

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yugal 0 Reputation points
    2024-01-10T12:29:25.31+00:00

    The issue was resolved after I added configuration for FUNCTIONS_WORKER_PROCESS_COUNT in azure function app.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.