stream to 100k of grains #7092
Replies: 3 comments
-
|
I would like to push this question higher as I'm facing similar issue. I have a trading app where each open position is a grain. Positions can be opened and closed multiple times during the day or even week but all activated position-grains remain active in memory and all of them are subscribed to stock price and maybe some other updates, so I can easily get a situation when 20K grains are subscribed to a single stream. So I was also wondering if Orleans was designed to make short-lived objects a grain or is it a bad practice. |
Beta Was this translation helpful? Give feedback.
-
|
Have you both considered Broadcast Channels? https://learn.microsoft.com/en-us/dotnet/orleans/streaming/broadcast-channel - when used creatively in combination with streams this is a useful abstraction for very large number of implicit subscribers. |
Beta Was this translation helpful? Give feedback.
-
|
@pedershk Broadcast channels are useful for targeting specific grains by a namespace and key - typically when when you want to message a grain but not worried about it being activated. If a grain that would receive the message not activated the broadcast will be lost. You cannot use it to broadcast to more than one grain of a particular type. I was very confused about how Broadcast Channels were intended to be used, but the comments in issue #8292 sorta cleared things up. Overall Broadcast Channels don't provide a solution to sending messages to "100k of [a particular grain]". I am trying to figure out some other solution as well other than a fanout of direct grain messaging. I only have 1000 ish "Foo" grains that need to get the same infrequently sent messages though, so direct grain messaging works, but I want a more optimal way. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys,
I have 100k of grain in state, I need update this grains by stream with receiver 100 request per seconds.
But when stream pulse the latence is hight, dosent exist bettle method for make this?
Beta Was this translation helpful? Give feedback.
All reactions