Akka.Net工作队列 [英] Akka.Net work queues

查看:98
本文介绍了Akka.Net工作队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于MassTransit和RabbitMQ构建的现有分布式计算框架.本质上,有一个经理根据请求响应工作.每个工人将根据物理机器规格获取一定数量的物品.然后,工作人员在完成后发送完成消息.它工作得很好,并且似乎具有很高的可伸缩性,因为唯一的链接是服务总线.

I have an existing distributed computing framework built on top of MassTransit and RabbitMQ. There is essentially a manager which responds with work based on requests. Each worker will take a certain amount of items based on the physcial machine specs. The worker then sends completion messages when done. It works rather well and seems to be highly scalable since the only link is the service bus.

我最近对Akka.Net进行了评估,以查看这是否是实现相同模式的更简单系统.看了之后,我对它的确切用途感到有些困惑.看来,如果我想做类似的事情,经理将不得不提前了解每个工人并将其直接发送给工作.

I recently evaluated Akka.Net in order to see if that would be a simpler system to implement the same pattern. After looking at it I was somewhat confused at what exactly it is used for. It seems that if I wanted to do something similar the manager would have to know about each worker ahead of time and directly send it work.

我相信我缺少一些东西,因为该模型似乎无法很好地扩展.

I believe I am missing something because that model doesn't seem to scale well.

推荐答案

像MassTransit这样的服务总线被构建为可靠的消息传递服务.确保消息传递是这里的首要任务.

Service buses like MassTransit are build as reliable messaging services. Ensuring the message delivery is primary concern there.

Actor框架也使用消息,但这是唯一的相似之处.消息传递只是实现目标的一种手段,并不像服务总线那样可靠.它们更注重于构建高性能,易于分布的系统拓扑,并围绕参与者作为主要工作单元.从概念上讲,actor接近Active Record模式(但是这是一个很大的简化).它们也很轻巧.您可以将数百万的内存保存在执行机器的内存中.

Actor frameworks also use messages, but this is the only similarity. Messaging is only a mean to achieve goal and it's not as reliable as in case of the service buses. They are more oriented on building high performance, easily distributed system topologies, centered around actors as primary unit of work. Conceptually actor is close to Active Record pattern (however this is a great simplification). They are also very lightweight. You can have millions of them living in memory of the executing machine.

在性能方面,Akka.NET能够在单个VM(在8个内核上进行测试)上每秒发送超过3000万条消息-比任何服务总线都要多得多,但特性也有很大差异.

When it comes to performance, Akka.NET is able to send over 30 mln messages/sec on a single VM (tested on 8 cores) - a lot more than any service bus, but the characteristics also differs significantly.

在JVM上,我们现在知道akka群集可能上升到 2400台计算机.不幸的是,我们无法测试.NET的实现限制.

On the JVM we now that akka clusters may rise up to 2400 machines. Unfortunately we where not able to test, what the .NET implementation limits are.

您必须确定自己真正需要什么:消息传递库,actor框架或两者的组合.

You have to decide what do you really need: a messaging library, an actor framework or a combination of both.

这篇关于Akka.Net工作队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆