fetch.max.bytes — Kafka Broker Configuration
The maximum amount of data the server should return for a fetch request. Records are fetched in batches by the consumer, and if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that the consumer can make progress.
Description
The maximum amount of data the server should return for a fetch request. Records are fetched in batches by the consumer, and if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that the consumer can make progress. As such, this is not a absolute maximum. The maximum record batch size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config). Note that the consumer performs multiple fetches in parallel.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 2.5 | 57671680 |
| 2.6 | 57671680 (55 mebibytes) |
| 2.7 | 57671680 (55 mebibytes) |
| 2.8 | 57671680 (55 mebibytes) |
| 3.0 | 57671680 (55 mebibytes) |
| 3.1 | 57671680 (55 mebibytes) |
| 3.2 | 57671680 (55 mebibytes) |
| 3.3 | 57671680 (55 mebibytes) |
| 3.4 | 57671680 (55 mebibytes) |
| 3.5 | 57671680 (55 mebibytes) |
| 3.6 | 57671680 (55 mebibytes) |
| 3.7 | 57671680 (55 mebibytes) |
| 3.8 | 57671680 (55 mebibytes) |
| 3.9 | 57671680 (55 mebibytes) |
| 4.0 | 57671680 (55 mebibytes) |
| 4.1 | 57671680 (55 mebibytes) |
| 4.2 | 57671680 (55 mebibytes) |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| consumer / throughput | 104857600 | Raising the per-FetchRequest cap from 50MB to 100MB allows the consumer to retrieve more data in a single network round-trip when many partitions are assigned. Critical when a single consumer handles 50+ partitions — the 50MB cap becomes a bottleneck shared across all partitions in one fetch cycle. |
Related Configs
fetch.min.bytes · fetch.max.wait.ms · max.partition.fetch.bytes · max.poll.records · receive.buffer.bytes · check.crcs