0

I am developing a .NET core application with the Azure Batch SDK. When it comes to creating the tasks I am wondering how many threads my task should consist of.

First I started to evaluate the number of CPU cores of the underlying node and spawn that amount of threads.

Later then, I realized it might be better to let the Azure Batch Scheduler do that work for me, tweak the pools requiredSlots and taskSlotsPerNode settings instead and only create single-threaded worker tasks.

Unfortunately, I couldn't find any advice in the documentation on the Azure Batch task to thread (TPL task) ratio.

Any advice on this?

Matthias Güntert
  • 4,013
  • 6
  • 41
  • 89

1 Answers1

0

There's no general answer to this question because it depends on your program and scenario. You should determine how best to run your workload and what important properties you want to leverage independent of Batch first: multi-threaded as a single program or multiple single-threaded programs?

Once you determine your approach, then apply that to Batch using the knobs the Batch API provides you.

fpark
  • 2,304
  • 2
  • 14
  • 21