[rabbitmq-discuss] Timeout for hung connection on rabbitmq server?

Francesco Mazzoli francesco at rabbitmq.com
Mon Aug 13 16:50:45 BST 2012


Hi Andrew,

At Mon, 13 Aug 2012 14:08:09 +0200,
Andrew McGill wrote:
>  * Is there a way to set the timeout value for a failed keepalive (assuming
>    keepalive packets are in fact being sent... I see the default tcp timeout
>    for Linux is two hours + 11 minutes, which is not quite what I need.)

Rabbit does not do anything to enable/disable TCP keepalives or change the
default values (also because per-socket tuning is not simple in everything but
Linux).  You can enable them via `tcp_listen_options', as you're correctly
doing.  To tune the keepalive parameters you must change them system-wide (see
http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ for some guidance).

However, AMQP itself provides a simpler solution to your problem: heartbeats -
see the `tune-ok' frame
<http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune-ok>.  On most
clients the heartbeats will be configurable when opening an AMQP connection.

>  * Alternatively, is there something in this configuration which will stop
>    keepalive from noticing that a connection has died?  (e.g. something to do
>    with the SSL connection parameters?)

Not that I can see.

>  * Even more alternatively, is there some way that the newest client
>    connection can identify itself as the best and most suitable instance of
>    itself when it makes the new connection?

It's not entirely clear to me what you mean here, but I'm reading it as
permitting connection to identify themselves as current incarnations of
previous, dead connections.  In that case, the answer is no.

--
Francesco * Often in error, never in doubt


More information about the rabbitmq-discuss mailing list