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 Version | Default Value |
|---|---|
| 0.7 | 200 |
| 0.8.1 | 16384 |
| 0.8.2 | 16384 |
| 0.9.0 | 16384 |
| 0.10.0 | 16384 |
| 0.10.1 | 16384 |
| 0.10.2 | 16384 |
| 0.11.0 | 16384 |
| 1.0 | 16384 |
| 1.1 | 16384 |
| 2.0 | 16384 |
| 2.1 | 16384 |
| 2.2 | 16384 |
| 2.3 | 16384 |
| 2.4 | 16384 |
| 2.5 | 16384 |
| 2.6 | 16384 |
| 2.7 | 16384 |
| 2.8 | 16384 |
| 3.0 | 16384 |
| 3.1 | 16384 |
| 3.2 | 16384 |
| 3.3 | 16384 |
| 3.4 | 16384 |
| 3.5 | 16384 |
| 3.6 | 16384 |
| 3.7 | 16384 |
| 3.8 | 16384 |
| 3.9 | 16384 |
| 4.0 | 16384 |
| 4.1 | 16384 |
| 4.2 | 16384 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| producer / throughput | 131072 | Increases 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 / latency | 16384 | Keep 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.