You're the expert, should it work? :)<div><br></div><div>I haven't tested that out, hadn't occurred to me to try.<br clear="all"><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 11:06 AM, Alexandru Scvorţov <span dir="ltr"><<a href="mailto:alexandru@rabbitmq.com">alexandru@rabbitmq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> We've been bitten by this with firewalls that close connections after idle<br>
> timeouts. Best solution I can come up with is to use TCP keepalives.<br>
<br>
Enabling heartbeats (when connecting with a client) didn't help?<br>
(heartbeats are the AMQP equivalent of TCP keep-alives)<br>
<br>
> If you client supports setting TCP options during the connection, that's<br>
> all you need to do for the client side part. For the server side, I<br>
> couldn't find any options for this in the rabbit config, so we implemented<br>
> libkeepalive to force the server to use keepalives.<br>
><br>
> Rabbit folks, please add this as an option to the server.<br>
<br>
I haven't tried, but I think you can enable keepalives in the<br>
rabbitmq.config. Just add a tcp_listen_options entry with {keepalive,<br>
true}:<br>
<br>
[<br>
{rabbit, [{tcp_listen_options, [{keepalive, true}]}]}<br>
].<br>
<br>
<a href="http://www.rabbitmq.com/configure.html#config-items" target="_blank">http://www.rabbitmq.com/configure.html#config-items</a><br>
<br>
Wouldn't something like that work?<br>
<br>
Cheers,<br>
Alex<br>
<br>
On Tue, Jan 03, 2012 at 10:47:43AM -0500, Mark Steele wrote:<br>
> We've been bitten by this with firewalls that close connections after idle<br>
> timeouts. Best solution I can come up with is to use TCP keepalives.<br>
><br>
> If you client supports setting TCP options during the connection, that's<br>
> all you need to do for the client side part. For the server side, I<br>
> couldn't find any options for this in the rabbit config, so we implemented<br>
> libkeepalive to force the server to use keepalives.<br>
><br>
> Rabbit folks, please add this as an option to the server.<br>
><br>
> Cheers,<br>
><br>
> Mark Steele, CISSP, CSM<br>
> Bering Media Inc.<br>
><br>
> On Tue, Jan 3, 2012 at 9:41 AM, Alexandru Scvorţov<br>
> <<a href="mailto:alexandru@rabbitmq.com">alexandru@rabbitmq.com</a>>wrote:<br>
><br>
> > > With 100's of computers connected to rabbitmq with persistent<br>
> > connections,<br>
> > > would this pose any problems?<br>
> ><br>
> > Not unless you run out of free file handles. On normal installations,<br>
> > it should handle up to thousands of connections without difficulty. You<br>
> > could further configure it to support more connections.<br>
> ><br>
> > > Does it time-out by default?<br>
> ><br>
> > No. Connections are not timed out.<br>
> ><br>
> > > Why use a heartbeat? Is it to re-establish if the heartbeat fails?<br>
> ><br>
> > If the network fails between a client and the broker, and there's no<br>
> > traffic between them at that point, both will think the connection is<br>
> > still open, even though it isn't. Heartbeats ensure that both broker<br>
> > and client are notified fairly quickly if the connection fails.<br>
> ><br>
> > > Would it be better for clients to close connections and only open a<br>
> > > connection when necessary?<br>
> ><br>
> > It depends on your use case.<br>
> ><br>
> > > For reading messages we need persistent connections.<br>
> > > But for writing, and I can see how we could potentially only open a<br>
> > > connection to write a message when required.<br>
> ><br>
> > For consuming messages *efficiently*, you need persistent connections.<br>
> > If you only get messages very rarely, you could open a connection, poll<br>
> > the broker with basic.get and then close the connection. But, if you<br>
> > need to consume a lot of messages, you probably want persistent<br>
> > connections anyway.<br>
> ><br>
> > Hope this helps.<br>
> ><br>
> > Cheers,<br>
> > Alex<br>
> ><br>
> > On Thu, Dec 29, 2011 at 05:21:26PM -0500, S Ahmed wrote:<br>
> > > With 100's of computers connected to rabbitmq with persistent<br>
> > connections,<br>
> > > would this pose any problems?<br>
> > ><br>
> > > Does it time-out by default?<br>
> > ><br>
> > > Why use a heartbeat? Is it to re-establish if the heartbeat fails?<br>
> > ><br>
> > > Would it be better for clients to close connections and only open a<br>
> > > connection when necessary?<br>
> > ><br>
> > > For reading messages we need persistent connections.<br>
> > ><br>
> > > But for writing, and I can see how we could potentially only open a<br>
> > > connection to write a message when required.<br>
> ><br>
> > > _______________________________________________<br>
> > > rabbitmq-discuss mailing list<br>
> > > <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> > > <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
> ><br>
> > _______________________________________________<br>
> > rabbitmq-discuss mailing list<br>
> > <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> > <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
> ><br>
</blockquote></div><br></div>