RabbitMQ 集群 [英] RabbitMQ clustering

查看:39
本文介绍了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 集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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