你好,我有一个问题,约有两天无法解决,所以我会在这里写得尽可能清楚,这样也可能对其他人有帮助。
"definition": {
"ha-mode": "exactly",
"ha-params": 2,
"ha-sync-mode": "automatic",
"ha-sync-batch-size": 1
}
def create_one_queue(queue_name, threadName, channel):
channel.queue_declare(queue=queue_name, durable=True, arguments={'x-queue-mode': 'lazy'})
for bind in BINDINGS:
channel.queue_bind(exchange=EXCHANGE, queue=queue_name, routing_key=bind.format(queue_name))
print("[{}]Created Queue {}".format(threadName, queue_name))
def create_queues(threadName, base):
channel = get_channel()
for i in range(0, 1000):
try:
queue_name = str(i + base)
create_one_queue(queue_name, threadName, channel)
except Exception as e:
print(e)
3.当我试图保持增长并到达20万个节点时,开始崩溃而又没有资源用尽。
我已经看过以下帖子:
https://www.rabbitmq.com/ha.html#ways-to-configure
https://www.cloudamqp.com/blog/2018-01-09-part3-rabbitmq-best-practice-for-high-availability.html
RabbitMQ - How many queues RabbitMQ can handle on a single server?
https://serverfault.com/questions/378165/rabbitmq-reasonable-performance-scale-expectations
http://rabbitmq.1065348.n5.nabble.com/How-many-queues-can-one-broker-support-td21539.html
https://www.quora.com/RabbitMQ/Can-rabbitMQ-or-zeroMQ-handle-1mil-queues
但是我看到矛盾(cloudamqp建议使用较少的队列,但在其他地方说您可能会到达1M队列)
非常感谢
好吧,我将用到目前为止的发现结果回答我的问题:
1)当我使用Kubernetes和Helm部署集群时,我在Pod中承受了很大的内存压力,没有剩余空间供垃圾收集器使用。https://www.rabbitmq.com/memory-use.html#queue-memory-usage-gc
2)似乎还可以。
3)为了创建200k持久和懒惰队列,我不得不使用10个节点的群集,每个节点具有8个vCPU和30 GB RAM。
注意:当我调整群集时,我将保持最新答案。