简体   繁体   中英

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

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?

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 to read https://dotnet.github.io/orleans/Documentation/grains/stateless_worker_grains.html - docs for stateless worker and it explicitly describes how it's different from a regular grains - few important aspects there, besides local activation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM