This document describes how to tune the parameters of the client to:
- Increase the throughput
- And/or reduce the latency
- And/or reduce the disk space used by the messages.
The parameters that can be tuned are:
SetBatchSize(batchSize)
andSetBatchPublishingDelay(100)
when use theSend()
method- The number of the messages when use the
BatchSend()
method
In this example you can play with the parameters to see the impact on the performances. There is not a magic formula to find the best parameters, you need to test and find the best values for your use case.
go run performances.go async 1000000 100;
The client supports also the batch entry size and the compression:
SetSubEntrySize(500).SetCompression(stream.Compression{}...
These parameters can be used to reduce the space used by the messages due of the compression and the batch entry size.
The default producer values are meant to be a good trade-off between throughput and latency. You can tune the parameters to increase the throughput, reduce the latency or reduce the disk space used by the messages.
To execute load tests, you can use the official load test tool: https://github.com/rabbitmq/rabbitmq-stream-perf-test