Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make sure that Orleans Grains end up in the same Silo

Tags:

c#

orleans

In our Orleans setup we have some Grains that frequently call each other. Is the performance of these Grain calls affected by them being in different Silos?

Is it possible to somehow tell Orleans to try activate a Grain in the same Silo as the calling Grain?

like image 240
The Hoff Avatar asked Nov 07 '25 01:11

The Hoff


1 Answers

Yes, network call is a network call and it will affect the performance of your calls.

You can put [PreferLocalPlacement] attribute on top of your grains, but AFAIK this can't be enforced, this is only a guidance for Orleans silo where to put new activation of the grain. This should work for both - state-full and stateless grains.

For purely stateless grains - you can use [StatelessWorker] attribute as Tseng suggested in his comment. I suggest you read the docs for stateless worker gains, they describe how they're different from regular grains. There are a few important aspects, besides local activation.

like image 174
Alexey Shcherbak Avatar answered Nov 08 '25 17:11

Alexey Shcherbak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!