[rabbitmq-discuss] Pika connection negotiation behavior

maitreya maitreya_vvm at yahoo.co.in
Thu Jun 6 06:35:56 BST 2013


Hi Matthias,

I had a problem with the Pika connection negotiation behavior which is 
leading to a situation where the heartbeat interval has a maximum 
possible value of 600s. The problem i had is the following,

I am using pika 0.9.9 with RabbitMQ 3.0.3. Few of the consumers we have 
are long running, so I would want to have a long heartbeat_interval so 
that the connections are not removed from either side. But the network 
infrastructure will not allow long idle connections so I wanted to set 
the heartbeat interval to 3600s(assuming pika is single threaded and can 
analyze the heartbeat events only between requests). But when I check 
the Timeout value in the RMQ Management page, I see it set only to 600.

Any number i try in the range of (300-600) works but above 600, it 
somehow defaults to 600. I think I didnt have this problem with RMQ 2.8. 
I am using php-amqplib for other piece of code and it is able to set 
heartbeat_interval to 3600s with RabbitMQ 3.0.3. My usage of creating a 
conncetion is as follows:


and my thoughts on why there shouldnt be a maximum value for heatbeat 
interval is the following,

I think the heartbeat interval should be flexible enough for different 
type of workers. For example, we have a combination of long-running 
tasks and short-running tasks. The short running tasks range from 1 to 
10 seconds. The long running tasks can take anytime depending on the 
input video size. So, for long running tasks, if the heartbeat interval 
set is 10 minutes, the client will not respond to the server's heartbeat 
for a long time which will result in the server disconnecting the 
client. Now the problem for disabling the heartbeat is the network 
infrastructure (like EC2) will kill any connections which are idle for 
more than about a day(dont know the exact time). So if the heartbeat is 
disabled then the connections are gone for good. An application can have 
a variety of load patterns, mine being short bursts with long idle time. 
So I think the heartbeat should be flexible enough to support a variety 
of consumers and different network infrastructures.

Please let me know your thoughts on this so that there could be a 
possible change in the client's connection behavior

regards,
Maitreya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130606/b9aa2593/attachment.htm>


More information about the rabbitmq-discuss mailing list