Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
RabbitMQ Essentials

You're reading from   RabbitMQ Essentials Build distributed and scalable applications with message queuing using RabbitMQ

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781789131666
Length 154 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Lovisa Johansson Lovisa Johansson
Author Profile Icon Lovisa Johansson
Lovisa Johansson
David Dossot David Dossot
Author Profile Icon David Dossot
David Dossot
Arrow right icon
View More author details
Toc

Specifying a consumer prefetch count

The number of messages sent to the consumer at the same time can be specified through the prefetch count value. The prefetch count value is used to get as much out of the consumers as possible.

If the prefetch count is too small, it could negatively affect the performance of RabbitMQ, since the platform is usually waiting for permission to send more messages. The following diagram shows an example of a long idle time. The example has the prefetch set to one, meaning that RabbitMQ will not send the next message until after the delivery, processing, and acknowledgment of the message is complete.

In the example, the processing time is only 5 ms, with a round-trip time of 125 ms (60 ms + 60 ms + 5 ms):

Fig 3.1: Round-trip time is 125 ms with a processing time of only 5 ms

A large prefetch count makes RabbitMQ send many messages from one queue to one consumer. If all messages are sent to a single consumer, it may be overwhelmed and leave the other consumers...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime