log.local.retention.ms — Kafka Broker Configuration
The number of milliseconds to keep the local log segments before it gets eligible for deletion. Default value is -2, it represents `log.
Description
The number of milliseconds to keep the local log segments before it gets eligible for deletion. Default value is -2, it represents `log.retention.ms` value is to be used. The effective value should always be less than or equal to `log.retention.ms` value.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 3.6 | -2 |
| 3.7 | -2 |
| 3.8 | -2 |
| 3.9 | -2 |
| 4.0 | -2 |
| 4.1 | -2 |
| 4.2 | -2 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| broker / cost | 86400000 | Keeps only 24 hours of data on local disk when tiered storage is enabled. Older segments are served from remote storage, reducing local disk usage by 80-95% for long-retention topics. |
Related Configs
remote.log.storage.system.enable · log.retention.ms · log.local.retention.bytes
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.