Corosync、ZeroMQ 和 Spread 的 CPG 在消息传递方面的比较如何?

发布于 2024-09-08 04:10:07 字数 415 浏览 2 评论 0原文

我感兴趣的是:

  • 性能
    • 延迟时间
    • 吞吐量
    • 资源使用情况(CPU、内存……)
  • 高可用性
    • 无单点故障
  • 特点
    • 交通选择
    • 路由选项
  • 稳定性
  • 社区
    • 积极开发
    • 广泛使用
    • 有用的邮件列表、论坛、IRC 频道……
  • 易于与我当前的代码库集成
  • 可能有陷阱
  • 你认为我省略的任何其他内容

我已经读过它们,但我找不到很好的比较。我特别对比较它们的性能基准感兴趣。 (也许我应该自己做一个!我希望不会。)

I'm interested in:

  • Performance
    • Latency
    • Throughput
    • Resource usage (CPU, memory, ...)
  • High availability
    • No single point of failure
  • Features
    • Transport options
    • Routing options
  • Stability
  • Community
    • Active development
    • Widely used
    • Helpful mailing list, forum, IRC channel, ...
  • Ease of integration with my current codebase
  • Gotchas maybe
  • Any other thing you think I omitted

I've read about them, but I couldn't find a good comparison. Specially I'm interested in performance benchmarks comparing them. (Maybe I should do one on my own! I hope not.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与他有关 2024-09-15 04:10:07

好吧,我还没有使用过其他两个,但可以分享我使用 ZeroMQ 的经验。在我看来,它比你所有的都出色。

速度和吞吐量

它与 TCP 一样快,不使用 CPU 或大量内存。它可以毫不费力地快速推送大量消息。在内存耗尽之前,它会使您的网络通道饱和(我怀疑您是否能够最大化 CPU)。在某个地方与 RabbitMQ 进行了比较,ZMQ 的性能比它高出 2 倍。从我读到的内容来看网络用于高速交易。

RabbitMQ也是一个非常好的工具。看看它 - 它可能很适合您正在寻找的内容

SPOF

如果您正确设计应用程序,那么您就不会出现单点故障。将两个插座连接到另一个插座非常容易。因此,如果其中一个失败了,另一个就可以处理工作。像高水位线这样的东西可以一路帮助你。阅读 ZeroMQ 指南,了解如何设计没有 SPOF 的应用程序。

传输和路由

关于传输选项(如果我理解正确的话)- 由您来定义您的协议。 ZeroMQ 基本上向您承诺它将将此数据块传递到另一端。使用 JSON、协议缓冲区、莫尔斯电码,无论你喜欢什么。

没有像 AMQP 那样的内置路由。同样,由您指定哪个 ZeroMQ 套接字连接到哪个,但这非常简单。

稳定性

我已经使用它进行了几个月的开发(使用 Python),并且没有发现其稳定性存在任何问题。即使当我尝试以错误的方式使用它时,它也会抛出一个很好的错误,告诉我不要这样做。即使重新启动/终止某些服务并将其恢复也不会导致任何问题。我想说这是一个非常稳定的软件。

请注意:始终使用最新版本 - 2.1 版本非常注重稳定性,因此解决了许多稳定性问题

社区

超过 20 种语言的 绑定、活跃的邮件列表、非常好的文档、频繁的发布。还要别的吗?

集成

因为它被设计为一个库,所以您可以自行设计应用程序(与框架的情况不同),并且它几乎不会妨碍您。它感觉有点像普通的 TCP 套接字,功能更强大且更易于使用(它保证消息将作为一个整体传递,而不仅仅是前 128 个字节以及后面的其余部分,就像常规套接字的情况一样)。

陷阱

有一些,但它们都记录在指南中。 (例如:当您连接(SUB)到 PUB 套接字时,您可能会错过来自 PUB 套接字的前几条消息。指南中有对此的解释以及如何处理它的秘诀)。

总的来说,

我发现这是设计最好的软件之一 - 稳定、编写良好、文档齐全并且不会妨碍我。

我建议您从头到尾阅读该指南。它写得很好,有很多语言(包括 C++)的示例,并且描述了很多边缘情况和痛点。

Well, I haven't used the other two, but can share my experiences with ZeroMQ. In my opinion, it excels at all of yours.

Speed and throughput

It's as fast as TCP, doesn't use CPU or a lot a memory. It can push A LOT of messages very quickly without a sweat. It will saturate your network channel way before you run out of memory (I doubt you'll ever be able to max-out the CPU). There was a comparison to RabbitMQ somewhere and ZMQ outperforms it by a factor of 2. From things I've read around the web it's in use in high speed trading.

RabbitMQ is also a very good tool. Have a look at it - it might be good fit for what you are looking

SPOF

If you design you application properly, then you can have no single point of failure. It's very easy to connect two sockets to another one. So if one of them fails - the other is there to handle the work. There are things like High water marks to help you along the way. Read the ZeroMQ Guide to learn how to design your app without a SPOF.

Transports and routing

Regarding transport options (if I'm understanding this correctly) - it's up to you to define your protocol. ZeroMQ basically promises you that it will deliver this blob of data to the other end. Use JSON, Protocol buffers, Morse code, whatever you like.

There is no built-in routing in like there is in AMQP. Again, it up to you to specify which ZeroMQ socket connects to which, but this is very easy.

Stability

I've been developing with it for a few months (using Python) and haven't found a single issue with its stability. Even when I try to use it the wrong way it just throws a nice error telling me not to do that. Even restarting/killing some of the services and bringing them back up doesn't cause any problems. I'd say it a very stable piece of software.

As a note: always use the latest version - the 2.1 version is very much stability oriented, so many stability issues are resolved in it.

Community

Bindings for more than 20 languages, active mailing list, very good documentation, frequent releases. Anything else?

Integration

Because it's designed as a library it's up to you to design you application (unlike the case with a framework) and it pretty much stands out of your way. It feels a bit like a normal TCP socket, much more powerful and easier to use (it guarantees you that a message will be delivered as a whole, not only the first 128 bytes and the rest later as it the case with regular sockets).

Gotchas

There are some, but they are all documented in the guide. (For example: you might miss the first few messages from a PUB socket when you connect (SUB) to it. There is an explanation to this in the guide and a recipe how to handle it).

Overall

I find this one of the best designed pieces of software - stable, well written, well documented and doesn't stand in my way.

I recommend you to read the guide end-to-end. It's well written, examples in a lot of languages (including C++) and it describes a lot of edge cases and pain points.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文