conduktor.io ↗

batch.size — Kafka Producer Configuration

The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition. This helps performance on both the client and the server.

Description

The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition. This helps performance on both the client and the server. This configuration controls the default batch size in bytes.

Default Values by Kafka Version

Kafka VersionDefault Value
0.7200
0.8.116384
0.8.216384
0.9.016384
0.10.016384
0.10.116384
0.10.216384
0.11.016384
1.016384
1.116384
2.016384
2.116384
2.216384
2.316384
2.416384
2.516384
2.616384
2.716384
2.816384
3.016384
3.116384
3.216384
3.316384
3.416384
3.516384
3.616384
3.716384
3.816384
3.916384
4.016384
4.116384
4.216384

Tuning Recommendation

ProfileRecommendedWhy
producer / throughput131072Increases batch capacity from 16KB to 128KB, allowing the producer to pack 8x more data per ProduceRequest and amortize per-request overhead across more records.
producer / latency16384Keep the default 16KB batch size. With linger.ms=0 the sender dispatches as soon as a record arrives regardless of batch fill level, so reducing batch.size does not make sends faster — it only reduces the maximum batching headroom available during bursts. The default 16KB is already conservative.

Related Configs

linger.ms · buffer.memory · max.request.size · compression.type · send.buffer.bytes · max.block.ms

Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.