<div dir="ltr">Hi Michael &amp; Emile,<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style>Thank you very much for the inputs.</div><div style><br></div><div style>I set the heartbeat interval to 25 seconds as below in the client.</div>
<div style><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>parameters � � �= � � � pika.ConnectionParameters(host=RABBITMQ_HOSTNAME,heartbeat_interval=25,credentials=pika.PlainCredentials(RABBITMQ_USERNAME,RABBITMQ_PASSWORD))</div>
</div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>connection � � �= � � � pika.SelectConnection(parameters,on_connected)</div></div></blockquote><div style><div style>
<br></div></div><div style><div style>My rabbitmq conifg looks like below</div></div><div style><div style><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>
[</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � {rabbit,</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style>� � � � � � � � [</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � � � � � � � � � {heartbeat,25},</div>
</div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � � � � � � � � � {tcp_listen_options, � �[binary, � � � �{packet, � � � �raw},</div></div>
</div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � � � � � � � � � � � � � � � � � � � � � {reuseaddr, � � true},</div></div></div></blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � � � � � � � � � � � � � � � � � � � � � {backlog, � � � 128},</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style>� � � � � � � � � � � � � � � � � � � � � � � � {nodelay, � � � true},</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>
<div style>� � � � � � � � � � � � � � � � � � � � � � � � {keepalive, � � true}]}</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � � � � � ]</div>
</div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style>� � � � }</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style>].</div></div></div></blockquote><div style><div style><div style><br></div></div></div><div style><div style><div style>I ran the rabbitmqctl list_connections timeout as below</div></div>
</div><div style><div style><div style><br></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style>root@ip-10-78-237-240:/mnt# rabbitmqctl list_connections timeout</div>
</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style>Listing connections ...</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style><div style>25</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style>...done.</div></div></div>
</div></blockquote><div style><div style><div style><div style><br></div></div></div></div><div style><div style><div style><div style>After 25 seconds, the connection dropped off. It says heartbeat_timeout in the logs</div>
</div></div></div><div style><div style><div style><div style><br></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style><div style>=INFO REPORT==== 8-Mar-2013::17:59:03 ===</div>
</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style><div style>accepting AMQP connection &lt;0.542.0&gt; (<a href="http://10.79.18.130:60527">10.79.18.130:60527</a> -&gt; <a href="http://10.78.237.240:5672">10.78.237.240:5672</a>)</div>
</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style><div style><br></div></div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style><div style><div style>=ERROR REPORT==== 8-Mar-2013::18:00:18 ===</div></div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>
<div style><div style><div style>closing AMQP connection &lt;0.542.0&gt; (<a href="http://10.79.18.130:60527">10.79.18.130:60527</a> -&gt; <a href="http://10.78.237.240:5672">10.78.237.240:5672</a>):</div></div></div></div>
</div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><div style><div style>{heartbeat_timeout,running}</div></div></div></div></div></blockquote><div style>
<div style><div style><div style><div style><br></div></div></div></div></div><div style><div style><div style><div style><br></div></div></div></div><div style><div style><div style><div style>I am not sure why the connection is dropped here. Am I doing anything wrong?</div>
</div></div></div></blockquote><div style><div style><br></div><div style>Thanks</div><div style>Nishanth</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 8, 2013 at 7:50 AM, Laing, Michael P. <span dir="ltr">&lt;<a href="mailto:Michael.Laing@nytimes.com" target="_blank">Michael.Laing@nytimes.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We keep connections alive for long periods in EC2.<br>
<br>
We set the heartbeat to 25 secs to achieve this, as elastic load<br>
balancers, in particular, have short timeouts.<br>
<br>
I would recommend upgrading to the latest rabbitmq and setting the<br>
heartbeat in the configuration.<br>
<br>
Look to see that it shows up in the management console. It&#39;s possible for<br>
client interface code to not agree to heartbeat w the server.<br>
<br>
Michael<br>
<div><div class="h5"><br>
On 3/8/13 4:56 AM, &quot;Emile Joubert&quot; &lt;<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt;Hi,<br>
&gt;<br>
&gt;On 07/03/13 22:59, Nishanth wrote:<br>
&gt;<br>
&gt;&gt; While they process the message, rabbitmq drops their connection silently<br>
&gt;&gt; as it considers them to have been idle for a long time.<br>
&gt;<br>
&gt;The broker will not drop connections silently. The culprit is more<br>
&gt;likely a firewall and enabling heartbeats is the correct way to solve<br>
&gt;the problem.<br>
&gt;<br>
&gt;&gt; I tried to set up heartbeat interval in worker connections but it didn&#39;t<br>
&gt;&gt; resolve the issue. It keeps timing out. I am not able to understand how<br>
&gt;&gt; this heartbeat work or how to debug to find out why its timing out.<br>
&gt;<br>
&gt;You can check that the heartbeat is indeed recognised in the broker by<br>
&gt;issuing &quot;rabbitmqctl list_connections timeout&quot;.<br>
&gt;<br>
&gt;If the heartbeat is set too long then connections may of course still be<br>
&gt;dropped, e.g. if an intervening firewall has a 10 minute timeout and the<br>
&gt;AMQP heartbeats are exchanged every 15 minutes then connections will<br>
&gt;still be dropped.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;-Emile<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt;_______________________________________________<br>
&gt;rabbitmq-discuss mailing list<br>
&gt;<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt;<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>
</blockquote></div><br></div>