You want to increase Producer throughput for the messages it sends to your Kafka cluster by tuning the batch size (‘batch.size’) and the time the Producer waits before sending a batch (‘linger.ms’).
To increase throughput, Kafka recommends allowing larger batches and giving more time for the producer to accumulate records into batches:
batch.size: Increasing this allows more records to be sent in a single request.
linger.ms: Increasing this adds a delay so that the producer can accumulate more messages into a batch.
From Kafka documentation:
“Increasing both batch.size and linger.ms allows the producer to send larger, more efficient batches, improving throughput at the cost of slightly increased latency.”
Page Reference:
Kafka: The Definitive Guide, 1st Edition, Chapter 5, p. 162–163
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit