[rabbitmq-discuss] Poor performance using a single RabbitMQ connection on high-latency networks
holger.hoffstaette at googlemail.com
Sat Jan 30 21:38:58 GMT 2010
On Sat, 30 Jan 2010 20:24:35 +0300, Vladimir Balandin wrote:
> We are using single connection as recommended in RabbitMQ FAQ. It is work
> fine in LAN but we have problems with WAN and high latency. RabbitMQ
> client send packets (packet size is 64 kB) too slow. We have installed
> RabbitMQ at remote server with ping from RabbitMQ client about 150-200 ms.
> Each basicPublish call require about 3 seconds to complete. So we have a
> throughput is about 20 kB/s. Increasing channel numbers does not affect
> performance. If we use two or more connections performance is increase
> linear, but it is not acceptable for us. We are unable to use so many
> connections that required to arrive full bandwidth usage. Is it possible
> to increase throughput using a single TCP connection?
Multiple connections are one way to help here; keep them in mind as an
option even if you don't want to open the full number of connections to
saturate your bandwidth.
Another thing to try is to increase the TCP send/receive buffers (and
therefore the negotiated TCP transmit windows) on the client.
Depending on the client's OS the default values of the TCP stack may or
may not be way too small for a connection with high latency. For example
they are outright pitiful on Windows XP.
An appropriate place would be to override (using the Java client as
example here) ConnectionFactory.configureSocket() and add the necessary
bits like setSend/ReceiveBufferSize etc. Usual values to try first are in
the range from 64k to 256k.
This should help. The behaviour with multiple channels will likely also be
improved. Changing the send/receive buffers on the broker side should not
be necessary, as the buffers are negotiated by the client.
More information about the rabbitmq-discuss