buffer.memory — Kafka Producer Configuration
The total bytes of memory the producer can use to buffer records waiting to be sent to the server. If records are sent faster than they can be delivered to the server the producer will block for max.block.ms after which it will fail with an exception.This setting should correspond roughly to the total memory the producer will use, but is not a hard bound since not all memory the producer uses is used for buffering
Description
The total bytes of memory the producer can use to buffer records waiting to be sent to the server. If records are sent faster than they can be delivered to the server the producer will block for max.block.ms after which it will fail with an exception.This setting should correspond roughly to the total memory the producer will use, but is not a hard bound since not all memory the producer uses is used for buffering. Some additional memory will be used for compression (if compression is enabled) as well as for maintaining in-flight requests.Type:longDefault:33554432Valid Values:[0,...]Importance:high
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Producer | 0.8.1 | 33554432 |
| Producer | 0.8.2 | 33554432 |
| Producer | 0.9.0 | 33554432 |
| Producer | 0.10.0 | 33554432 |
| Producer | 0.10.1 | 33554432 |
| Producer | 0.10.2 | 33554432 |
| Producer | 0.11.0 | 33554432 |
| Producer | 1.0 | 33554432 |
| Producer | 1.1 | 33554432 |
| Producer | 2.0 | 33554432 |
| Producer | 2.1 | 33554432 |
| Producer | 2.2 | 33554432 |
| Producer | 2.3 | 33554432 |
| Producer | 2.4 | 33554432 |
| Producer | 2.5 | 33554432 |
| Producer | 2.6 | 33554432 |
| Producer | 2.7 | 33554432 |
| Producer | 2.8 | 33554432 |
| Producer | 3.0 | 33554432 |
| Producer | 3.1 | 33554432 |
| Producer | 3.2 | 33554432 |
| Producer | 3.3 | 33554432 |
| Producer | 3.4 | 33554432 |
| Producer | 3.5 | 33554432 |
| Producer | 3.6 | 33554432 |
| Producer | 3.7 | 33554432 |
| Producer | 3.8 | 33554432 |
| Producer | 3.9 | 33554432 |
| Producer | 4.0 | 33554432 |
| Producer | 4.1 | 33554432 |
| Producer | 4.2 | 33554432 |
| Producer | 4.3 | 33554432 |
| Producer | 4.4 | 33554432 |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| producer / throughput | 134217728 | Budgets producer record buffering during bursts or temporary downstream slowdown. Tradeoff: It is not a hard cap on total producer process memory, and increasing it cannot fix sustained downstream saturation. Reference · 2026-10-27 |
| producer / durability | 67108864 | Budgets producer record buffering during bursts or temporary downstream slowdown. Tradeoff: It is not a hard cap on total producer process memory, and increasing it cannot fix sustained downstream saturation. Reference · 2026-10-27 |
Related Configs
batch.size · linger.ms · max.block.ms · delivery.timeout.ms