max.request.size — Kafka Producer Configuration
The maximum size of a request in bytes. This setting will limit the number of record batches the producer will send in a single request to avoid sending huge requests.
Description
The maximum size of a request in bytes. This setting will limit the number of record batches the producer will send in a single request to avoid sending huge requests. This is also effectively a cap on the maximum uncompressed record batch size. Note that the server has its own cap on the record batch size (after compression if compression is enabled) which may be different from this.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.8.1 | 1048576 |
| 0.8.2 | 1048576 |
| 0.9.0 | 1048576 |
| 0.10.0 | 1048576 |
| 0.10.1 | 1048576 |
| 0.10.2 | 1048576 |
| 0.11.0 | 1048576 |
| 1.0 | 1048576 |
| 1.1 | 1048576 |
| 2.0 | 1048576 |
| 2.1 | 1048576 |
| 2.2 | 1048576 |
| 2.3 | 1048576 |
| 2.4 | 1048576 |
| 2.5 | 1048576 |
| 2.6 | 1048576 |
| 2.7 | 1048576 |
| 2.8 | 1048576 |
| 3.0 | 1048576 |
| 3.1 | 1048576 |
| 3.2 | 1048576 |
| 3.3 | 1048576 |
| 3.4 | 1048576 |
| 3.5 | 1048576 |
| 3.6 | 1048576 |
| 3.7 | 1048576 |
| 3.8 | 1048576 |
| 3.9 | 1048576 |
| 4.0 | 1048576 |
| 4.1 | 1048576 |
| 4.2 | 1048576 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| producer / throughput | 5242880 | Raising the max request size to 5MB allows larger compressed batches to be sent in a single ProduceRequest, reducing round-trips and fully exploiting batch.size=128KB at high message rates. |
Related Configs
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.