java RabbitMQ 连接处于阻塞状态?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10427028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
RabbitMQ connection in blocking state?
提问by jayesh
I connect to RabbitMQ server that time my connection display in blocking state and i not able to publish new message i have ram of 6 gb free and disk space also be about 8GB
那时我连接到 RabbitMQ 服务器,我的连接显示为阻塞状态,但我无法发布新消息我有 6 GB 可用内存,磁盘空间也大约为 8 GB
how to configure disk space limit in RabbitMQ
如何在RabbitMQ中配置磁盘空间限制
回答by Van Thoai Nguyen
I got the same problem. Seem like the rabbitmq server was using more memory than the threshold
我遇到了同样的问题。似乎rabbitmq 服务器使用的内存超过阈值
http://www.rabbitmq.com/memory.html
http://www.rabbitmq.com/memory.html
I ran following command to unblock these connections:
我运行以下命令来取消阻止这些连接:
rabbitmqctl set_vm_memory_high_watermark 0.6
rabbitmqctl set_vm_memory_high_watermark 0.6
(default value is 0.4)
(默认值为 0.4)
回答by Dmitri S
By default, [disk_free_limit](source: [1]) must exceed 1.0 times of RAM available. This is true in your case so you may want to check what exactly is blocking the flow. To do that, read [rabbitmqctl man](source: [2]), and run the last_blocked_by command. That should tell you the cause for blocking.
默认情况下,[disk_free_limit](source: [1]) 必须超过可用 RAM 的 1.0 倍。在您的情况下确实如此,因此您可能需要检查究竟是什么阻塞了流量。为此,请阅读 [rabbitmqctl man](来源:[2]),然后运行 last_blocked_by 命令。这应该会告诉您阻塞的原因。
Assuming it is memory (and you somehow didn't calculate your free disk space correctly), to change disk_free_limit, read [configuring rabbitmq.config](source: [1]), then open your rabbitmq.config file and add the following line: {rabbit, [{disk_free_limit, {mem_relative, 0.1}}]}
inside the config declaration. My rabbitmq.config file looks as follows:
假设它是内存(并且您以某种方式没有正确计算可用磁盘空间),要更改 disk_free_limit,请阅读 [配置 rabbitmq.config](来源:[1]),然后打开您的 rabbitmq.config 文件并添加以下行:{rabbit, [{disk_free_limit, {mem_relative, 0.1}}]}
在配置声明中。我的 rabbitmq.config 文件如下所示:
[
{rabbit, [{disk_free_limit, {mem_relative, 0.1}}]}
].
The specific number is up to you, of course.
当然,具体数字由您决定。
Sources
来源