[rabbitmq-discuss] BrokerUnrechableException after sending 16366 messages

Simon MacMullen simon at rabbitmq.com
Fri Oct 21 16:22:55 BST 2011


On 21/10/11 16:14, James Carr wrote:
> One "newb" mistake I often see when devs are initially testing out our
> dev cluster is they open a connection for each message they send
> rather than opening one connection and re-using it.  This will quickly
> use up all the connections on the box and rabbitmq will begin refusing
> additional requests to connect.

You should be fine of course as long as you are *closing* those 
connections too. RabbitMQ will only refuse connections when you have too 
many active ones.

But.

If you churn through connections at a frantic rate, you can get into a 
state where the entire *client* box can't make outgoing connections for 
a while, as all your ports in the ephemeral port range still have the 
remains of an old connection sitting there in the TCP_WAIT state.

If you run into this it's usually a sign that you should be a bit more 
economical with connections (to put it mildly), but on Linux at least 
you can work around it with:

# echo "1" >/proc/sys/net/ipv4/tcp_tw_reuse
# echo "1" >/proc/sys/net/ipv4/tcp_tw_recycle

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list