Stream Consumption Capped at 150mps #539
-
I have a stream with around 3000 messages, with each message sized at around 250 bytes. My application is consuming the stream messages using the RabbitMQ Stream Java Client. When the MessageHandler is doing no processing, the consumption rate is consistently around 150 messages/second - regardless of whether the offset is set to the beginning ( This rate is considerably lower than what I was expecting, but I am new to RabbitMQ, so maybe my expectations are off. RabbitMQ and the client application are both running in rootless containers on the same host managed by podman. Stream configuration Stream stats RabbitMQ Client Application |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
A single stream is usually much faster (~ 100 K messages / second, but that depends on many parameters). You should try experiment with Stream PerfTest to establish a baseline in your environment. |
Beta Was this translation helpful? Give feedback.
-
Thanks Arnaud for your quick reply. I ran the performance test, and if I am correctly interpreting the results, I am seeing a potential of 400k+ messages per second.
Can you suggest where I should look to try to determine why the application's performance is so poor? I am using just the basic methods to build the
Thanks again for your help. |
Beta Was this translation helpful? Give feedback.
-
Yes -- I can create a simple project which captures what I am doing on the stream consumer side, but I am not producing messages for the stream from the an application. I realize now that I probably should have mentioned that up-front, because when I use the
In my current test environment, I have 3 monitoring applications which publish (each at a rate of 1 message every 10 seconds) to the RabbitMQ broker using MQTT protocol. I have a binding in with the |
Beta Was this translation helpful? Give feedback.
-
I performed some additional testing and found when there was zero (or close to it) delay when publishing to the stream, or when using batching, that when later consuming from those streams, that it was considerably faster. Also, looking at the file system storage for the streams, for streams where the consumption rate is high, the size of the segment index is small (I tested with a stream where the max length max segment size where equal). Is this the behaviour of streams, that messages need to be published to the stream in batches or in a continuously in order to be able to later consume from the stream at a high rate?
|
Beta Was this translation helpful? Give feedback.
-
Yes, streams are optimized for high ingress. They store messages in "chunks", which is also the unit of delivery and replication. So a client receives a whole chunk of messages, which can be made of a few messages to a few thousand. The higher the ingress, the bigger the chunk size. We optimized the delivery code to squeeze several chunks in one TCP packet, but this is not always enough to speed up delivery with very small chunks. The index file contains the chunk-to-file-index mapping, so the more chunks, the larger it gets. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation Arnaud. Are you aware of any Osiris tool/utility which could be used to repack the messages into higher density chunks? |
Beta Was this translation helpful? Give feedback.
Yes, streams are optimized for high ingress. They store messages in "chunks", which is also the unit of delivery and replication. So a client receives a whole chunk of messages, which can be made of a few messages to a few thousand. The higher the ingress, the bigger the chunk size.
We optimized the delivery code to squeeze several chunks in one TCP packet, but this is not always enough to speed up delivery with very small chunks.
The index file contains the chunk-to-file-index mapping, so the more chunks, the larger it gets.