Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Orleans maximum grains per silo

I am testing Microsoft Orleans for feasibility as a distributed computing framework. It seems like it may work however I was wondering how do I set the maximum number of active grains in a given silo?

My grains will not purely be CPU bound and will perform some IO and other related tasks. I am worried that if I let it run wild it will spin up a massive number of instances which will bog the whole thing down.

Is silo configuration like this possible?

like image 621
Telavian Avatar asked Sep 13 '25 12:09

Telavian


1 Answers

Orleans is very well suited for non-CPU-bound work. Orleans grains are designed to use Task<T> for asynchrony instead of threads, so you should always perform asynchronous IO, using C#'s [async/await][1] feature.

If you absolutely need to perform blocking IO, you can perform the IO outside the context of the grain and await the result in your grain, like so:

var result = await Task.Run(() => {
  // Perform blocking work.
  return 43;
});
like image 99
Reuben Bond Avatar answered Sep 15 '25 23:09

Reuben Bond