[rabbitmq-discuss] Publishing: Connection timeout issue

Tim Watson tim at rabbitmq.com
Fri Nov 30 12:39:57 GMT 2012


On 30 Nov 2012, at 12:13, Borman Squirrel wrote:

> Hi Alan, thanks for the response!
> 
> I've checked there are no problems with creating an other connection for
> publishing if the connection dies due to time connection problem (since the
> source ports are different), thus the broken connections are still on the
> server.
> 

If a connection has timed out, the broker will have cleaned up any server resources automatically. When you send an explicit connection.close to the broker, it responds with connection.close_ok, after which the connection is removed from the server and resources are released. If a connection isn't closed explicitly, the underlying network infrastructure will eventually notify the broker that the socket is no longer in use (because successive retries have exhausted kernel configured limits, etc) and the resources will be cleaned up then. This can take a while. 

> Does exist some way for cleaning these dead connections on the server?
> 

Enabling AMQP heartbeats can make this happen sooner, as can configuring tcp keepalives at the OS level, though I'd advise against the latter unless you fully understand all the potential consequences.  


More information about the rabbitmq-discuss mailing list