On Wed, Jun 14, 2023 at 12:45:38AM -0700, Arnaud Cogoluègnes wrote:
> With small messages (~10 bytes) and batching at 100, we usually get around
> 1 M messages / second. Can you experiment with stream-perf-test [1]?
I am aware of these numbers, but let's avoid comparing different testing
conditions (Python vs Java, and I suspect: single threaded vs
multithreaded, waiting for confirmations vs background thread to receive
those, no cpu turbo vs cpu turbo enabled, laptop vs server).
> Batching publish confirms more aggressively means delaying them, meaning
> adding latency. This could also slow down publishers that have an
> outstanding confirms limit (most of the client libraries we maintain do).
> Moreover it could be awkward and complex to implement on the broker side.
I do understand, but this is what I observe.
For reference, if I send a batch of
- 100 messages, the confirmations come back in two tranches (64 and 36 ids)
- 64 messages, the confirmations come back in two tranches (32 and 32 ids)
- 32 messages, the confirmations come back in a single tranche of 32 ids
On the protocol level, when sending batch of 100 small messages, RabbitMQ
Streams receives a single "Publish" protocol frame. That single frame says
what number of published messages is. There is nothing to guess, and there
is nothing to wait for here.
Also, 128 message publishing ids (as the broker responds in power of 2)
encoded within "PublishConfirm" protocol frame is 1029 bytes, if I am not
mistaken. Well below a typical ethernet MTU, for example?
[...]
> We consider streams to be quite fast already.
Indeed, there is nothing to worry about here (I hope to publish some
performance tests comparing to aiokafka this month). Just trying to see if
I can optimize for my use case.
[...]