[英]Akka.NET: Restrict child actor creation in akka.net cluster to a single machine
We have a particular scenario in our application - All the child actors in this application deals with huge volume of data (Around 50 - 200 MB). 我们的应用程序中有一个特殊的场景-该应用程序中的所有子参与者都处理大量数据(大约50-200 MB)。 Due to this, we have decided to create the child actors in the same machine (worker process) in which parent actor was created.
因此,我们决定在创建父actor的同一台计算机(工作进程)中创建子actor。
Currently, this is achieved by the use of Roles.
当前,这是通过使用角色来实现的。 We also use .NET memory cache to transfer the data (Several MBs) between child actors.
我们还使用.NET内存缓存在子参与者之间传输数据(几个MB)。
Question : Is it ok to turn off clustering in the child actors to achieve the result we are expecting? 问题 :是否可以关闭子actor中的群集以达到我们期望的结果?
Edit : To be more specific, I have explained the our application setup in detail, below. 编辑 :更具体地说,我在下面详细说明了我们的应用程序设置。
When we found out the network overhead caused by distributing the child actors across machines, we decided to restrict child actor creation to the corresponding machines which received the primary request, and distribute only the parent actor across machines. 当我们发现由在各个计算机之间分布子actor导致的网络开销时,我们决定将子actor的创建限制为接收到主要请求的相应计算机,而仅在各个计算机之间分配父actor。
While approaching an Akka.NET expert with this problem, we were advised to use "Roles" in order to restrict the child actor creation to a single machine in a cluster system. 当与Akka.NET专家联系时,建议我们使用“角色”,以将子角色的创建限制在群集系统中的单个计算机上。 (Eg, Worker1Child, Worker2Child instead of "Child" role)
(例如,Worker1Child,Worker2Child而不是“ Child”角色)
Question (Contd.) : I just want to know, if simply by disabling cluster option in child actors will achieve the same result; 问题(续) :我只是想知道,如果仅通过在子actor中禁用集群选项就能达到相同的结果; and is it a best practice to do so?
这是最佳做法吗?
Please advise. 请指教。
Sounds to me like you've been using a clustered pool router to remotely deploy worker actors across the cluster - you didn't explicitly mention this in your description, but that's what it sounds like. 在我看来,您一直在使用集群池路由器在集群中远程部署工作人员-您在描述中没有明确提及,但这听起来很像。
It also sounds like, what you're really trying to do here is take advantage of local affinity: have child worker actors for the same entities all work together inside the same process. 听起来,您在这里真正想做的就是利用本地亲缘关系:让同一实体的童工演员在同一流程中一起工作。
Here's what I would recommend: 这是我的建议:
Given the information that you've provided here, this is as close to a "general" answer as I can provide - hope you find it helpful! 鉴于您在此处提供的信息,这与我所能提供的“一般”答案非常接近-希望对您有所帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.