Gaploid
Gaploid

Reputation: 99

How many tasks I can execute inside the azure function?

I have some kind of that code in my azure function:

foreach (var ins in instances)
{
   TaskList.Add(ins.DeallocateAsync());
}
Task.WaitAll(TaskList.ToArray());

And I'm wondering how many parallel tasks can be spawned inside the one azure function? Is the host tolerant for such model or it will kill subprocess?

Upvotes: 3

Views: 925

Answers (1)

hemantsharma
hemantsharma

Reputation: 535

@Gaploid I recommend to use durable functions in such scenarios which maintains yours state for the such long running operations.

Also, as MS recommends, azure functions should be less time consuming operations because if you're running your azure function in consumption plan then you may found it a bit unresponsiveness for your calls as Azure functions cold starts after an specific idle time. So when it restarts your lengthy process would be more complicated to boot up.

More importantly, if you use orchestration aka durable functions, you'll found yourself in saving some money as MS doesn't charges you for you background tasks.

specifically, you can run as much as threads/tasks in case you're using durable one as preferred by MSFT.

Upvotes: 3

Related Questions