[rabbitmq-discuss] What happens to messages delivered just before canceling consume?

Matthew Sackman matthew at rabbitmq.com
Wed May 23 10:39:54 BST 2012

On Fri, May 18, 2012 at 12:25:25PM -0600, Chris wrote:
> Thank you for linking the blog post.. very informative. I had not
> thought about the potential consequences of using a prefech of 1, but
> you clearly explained the tradeoffs.

I'm glad it makes sense.

> Obviously no one is on a network with 0 latency, but all nodes of my
> application are on the same (small) LAN, and will have low latency.
> Also the time it takes to process a single message received by one of
> my consumers can vary wildly, from about 1 second to 15 seconds, and
> it is important that they get processed ASAP, even though they can
> take this amount of time. In this situation do you believe I am
> justified in using a prefetch count of 1?

Yes. If you have a prefetch of 2, and a message can take up to 15
seconds to process, then you could potentially have a message buffered in
the client for nearly 15 seconds. If that's unacceptable (i.e. doesn't
meet your definition of ASAP) then a prefetch of 1 will be better. Given
the relative ratios of processing time and network latency, it seems
likely to me a very low prefetch is the right thing to do there.


More information about the rabbitmq-discuss mailing list