[rabbitmq-discuss] Producers hanging when reaching high memory watermark on 1.8.1

Matthias Radestock matthias at rabbitmq.com
Mon Aug 16 04:58:57 BST 2010


Dave,

Dave Greggory wrote:
> What I'm trying to achieve is to get my client apps to be unaffected
> if RabbitMQ goes down. In this case, from hitting high memory
> watermark. Right now, when Rabbit hits that watermark, the clients
> hang or slow down to a crawl. Maybe that is caused by the threads
> being blocked by flow control, there by making it appear to be hung.
> 
> I don't want that. I want sends to throw an exception or some other
> event I can respond to so that the client apps don't break down or
> suffer a performance hit just because they lose messaging
> functionality. How do I do that?

There can be many conditions that cause a service to slow down - network 
congestion and outages, load on the server machine, etc. 
Server-initiated flow control is just one of them, i.e. to a client 
application it will simply appear as (sometimes very) slow service.

So this then becomes a question of deciding when publishing is "too 
slow", and being able to continue (w/o publishing) when it is.

One way to do that would be to have a single publishing thread that is 
fed publishes via a thread-safe queue from other threads. The app 
threads can then decide whether to enqueue another publish based on the 
queue's length. Or the publishing thread could record the time the 
currently underway publish (if there is one) was started and app threads 
would use that information to make the publish/not-publish decision 
instead. Or you could come up with yet more elaborate schemes.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list