What is the difference between the channel prefetch count and consumer prefetch count?

https://stackoverflow.com/questions/43783714/what-is-the-difference-between-the-channel-prefetch-count-and-consumer-prefetch

 

A recent upgrade to RabbitMQ server sees a change in the prefetch count reported for a consumer in the admin panel.

What is the difference between the channel prefetch count and consumer prefetch count as seen below?

What is the difference between the channel prefetch count and consumer prefetch count?

We are running a set-up where we have multiple threads consuming off of a single consumer/channel. We allow the thread count and prefetch count to be adjusted on the fly. What combination of parameters to the Model.BasicQos(prefetchLength, prefetchCount, global); call on the c# client should we be using?

rabbitmq

shareedit

asked May 4 '17 at 13:05

What is the difference between the channel prefetch count and consumer prefetch count?

yenta

763618

add a comment

1 Answer

activeoldestvotes

4

 

Basically prefetch in both cases means (maximum allowed) number of unacknowledged messages, per channel or per consumer. Check out here under title Channel Prefetch Setting (QoS). Important to note in case of channel prefetch (I'll just quote from aforementioned link)

Once the number reaches the configured count, RabbitMQ will stop delivering more messages on the channel unless at least one of the outstanding ones is acknowledged.

so no more messages to any of the consumers on that channel!

Nice examples on what numbers mean what and what happens when both of the prefetch values are set can be found here, so really what you need for the values in your case is arbitrary but obviously depends on various factors like: frequency of publishing, size of messages, number of consumers etc.

In the screenshot it seems that your consumer prefetch is bigger than channel prefetch. Now I don't know what the web management ui is reporting nor how do rabbitmq or the c# library handle this, but I would say that based on what is written in the documentation that consumer prefetch count can only be less or equal to channel prefetch count (I mean of course when it's actually used in runtime, not at declaring).

shareedit

answered May 4 '17 at 17:57

What is the difference between the channel prefetch count and consumer prefetch count?

cantSleepNow

5,67532036