[rabbitmq-discuss] Why default connection heartbeat = 0?

Emile Joubert emile at rabbitmq.com
Wed Mar 28 13:48:50 BST 2012


On 28/03/12 13:05, stone wrote:
> One more question, what could possibly be impacted if the default
> heartbeat value is set to 2, 3 or 5 etc. ? 

There is a trade-off. More frequent heartbeats incur greater network and
CPU overhead but detect network conditions earlier. Lower frequencies
incur less overhead but are slower to detect network problems. You
should set the value appropriately for you environment.

In answer to your previous question, some reasons for the current
default have come to light. In previous versions of RabbitMQ (before
v1.7.0) the heartbeat was set to a non-zero value and this caused these

On busy machines the heartbeats would not be generated quickly enough
and this lead to dropped connections and poor performance.

One machines with thousands of connections the effort of generating
heartbeats would consume all the CPU resources.

On brokers that have no activity the heartbeats would prevent paging to
disk and even Erlang hibernation.


More information about the rabbitmq-discuss mailing list