gpt4 book ai didi

erlang - 使 RabbitMQ 代理上的非事件连接过期

转载 作者:行者123 更新时间:2023-12-04 23:54:00 34 4
gpt4 key购买 nike

我遇到了 RabbitMQ 代理的连接限制

此线程中讨论了一种提高允许连接数的方法: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-May/013033.html

On Mon, May 30, 2011 at 06:19:47PM +0530, Dhinesh Kumar wrote:

I am trying to find the maximum number of amqp connections i can establishwith a RabbitMQ broker running on Ubuntu.I tried both Java and erlang client to create connections but i could notsucceed more than 829 connections.

I like to know how can i increase the number ??

并提供了一个解决方案:

On Mon, May 30, 2011 at 8:14AM, Matthew Sackman wrote:

You're likely hitting the ulimit. Edit /etc/security/limits.conf andallow the rabbitmq user to have a much higher "nofile" setting. Rabbitwill log on start up how many sockets it's permitting, so once thechange has taken effect and you've restarted rabbit, you should findlog entries to demonstrate it's working.

Matthew





虽然我可以提高这个限制,但我宁愿关闭未使用的连接。是否有一种方法可以使在一定时间内未使用的连接过期?

最佳答案

我通过打开心跳解决了这个问题:

https://github.com/pika/pika/blob/master/pika/heartbeat.py

params = ConnectionParameters(host='127.0.0.1', heartbeat=True)
connection = BlockingConnection(params)

这样,如果连接中断,服务器会处理关闭它。

关于erlang - 使 RabbitMQ 代理上的非事件连接过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8437471/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com