log.segment.bytes — Kafka Broker Configuration
The maximum size of a single log file.
Description
The maximum size of a single log file
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.8.0 | 1024 * 1024 * 1024 |
| 0.8.1 | 1024 * 1024 * 1024 |
| 0.8.2 | 1024 * 1024 * 1024 |
| 0.9.0 | 1073741824 |
| 0.10.0 | 1073741824 |
| 0.10.1 | 1073741824 |
| 0.10.2 | 1073741824 |
| 0.11.0 | 1073741824 |
| 1.0 | 1073741824 |
| 1.1 | 1073741824 |
| 2.0 | 1073741824 |
| 2.1 | 1073741824 |
| 2.2 | 1073741824 |
| 2.3 | 1073741824 |
| 2.4 | 1073741824 |
| 2.5 | 1073741824 |
| 2.6 | 1073741824 (1 gibibyte) |
| 2.7 | 1073741824 (1 gibibyte) |
| 2.8 | 1073741824 (1 gibibyte) |
| 3.0 | 1073741824 (1 gibibyte) |
| 3.1 | 1073741824 (1 gibibyte) |
| 3.2 | 1073741824 (1 gibibyte) |
| 3.3 | 1073741824 (1 gibibyte) |
| 3.4 | 1073741824 (1 gibibyte) |
| 3.5 | 1073741824 (1 gibibyte) |
| 3.6 | 1073741824 (1 gibibyte) |
| 3.7 | 1073741824 (1 gibibyte) |
| 3.8 | 1073741824 (1 gibibyte) |
| 3.9 | 1073741824 (1 gibibyte) |
| 4.0 | 1073741824 (1 gibibyte) |
| 4.1 | 1073741824 (1 gibibyte) |
| 4.2 | 1073741824 (1 gibibyte) |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| broker / throughput | 536870912 | Reducing segments to 512MB means segments roll more frequently, enabling faster log compaction and retention enforcement without accumulating 1GB of data per partition before any cleanup can happen. At very high write rates, smaller segments reduce the window of data at risk if a single segment is corrupt. |
| broker / cost | 268435456 | Smaller segments (256MB) allow the retention enforcement loop to reclaim disk more granularly. With 1GB segments, a topic that hits its retention byte limit must wait for a full 1GB segment to be eligible for deletion; with 256MB segments, cleanup is 4x more precise. |
Related Configs
log.retention.bytes · log.retention.hours · log.index.size.max.bytes · background.threads · log.retention.check.interval.ms · log.segment.delete.delay.ms · num.partitions
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.