RabbitMQ 集群

编程入门 行业动态 更新时间:2024-10-15 18:22:55
本文介绍了RabbitMQ 集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在单台 Windows 机器上创建了 RabbitMQ 集群,所有的 HA 策略都设置了,并创建了两个 DISC 和两个 RAM 节点和 1 个 STAT 节点.然后我运行了 PerfTest(rabbitmq 客户端测试实用程序),结果令人失望,大约是 5000 米/秒.但是当我用单个 RabbitMQ 节点运行相同的测试时,它给了我很好的结果,即 25000 米/秒.我无法弄清楚发生了什么问题,如果在集群内运行,其结果应该令人印象深刻,但恰恰相反.任何人都遇到过同样的情况或者知道背后的原因.谢谢

I have created RabbitMQ cluster on single windows machine with HA policy to all and created two DISC and two RAM node and 1 STAT node. I then ran the PerfTest (rabbitmq client test utility), the result were disappointing, it was around 5000m/sec. But when I ran the same test with single RabbitMQ node it gave me good result i.e. 25000m/sec. I am unable to get what wrong is happening, its result should be impressive if run within cluster, but it is opposite. Anyone have encounter the same or if know the reason behind it. Thanks

推荐答案

具有镜像队列的 RabbitMQ 集群的运行速度不会比单个节点快.为什么?集群是为了提高可靠性和容错性,而不是为了提高吞吐量.

A RabbitMQ Cluster with Mirrored Queues won't go faster than a single node. Why? Clustering is there to improve reliability and fault tolerance, not to improve throughput.

这是什么原因?当启用镜像队列时,RabbitMQ 需要协调节点之间的状态,即它需要协调发布、消费者和确认,不能多次传递相同的消息,或者传递给多个消费者.所有这些协调都会影响性能,但这是这种复制的权衡.

What's the reason for this? When you enable mirrored queues, RabbitMQ needs to coordinate state between nodes, that is, it needs to coordinate publishes, consumers and acks, to not deliver the same message more than once, or to more than one consumer. All this coordination affects performance, but that's the tradeoff with this kind of replication.

如果你需要去中心化复制,那么你可以使用联邦插件

If you need decentralised replication, then you could use the Federation Plugin

更多推荐

RabbitMQ 集群

本文发布于:2023-11-24 12:30:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   RabbitMQ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!