log.retention.hours — Kafka Broker Configuration
The number of hours to keep a log file before deleting it (in hours), tertiary to log.retention.
Description
The number of hours to keep a log file before deleting it (in hours), tertiary to log.retention.ms property
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.7 | 168 |
| 0.8.0 | 24 * 7 |
| 0.9.0 | 168 |
| 0.10.0 | 168 |
| 0.10.1 | 168 |
| 0.10.2 | 168 |
| 0.11.0 | 168 |
| 1.0 | 168 |
| 1.1 | 168 |
| 2.0 | 168 |
| 2.1 | 168 |
| 2.2 | 168 |
| 2.3 | 168 |
| 2.4 | 168 |
| 2.5 | 168 |
| 2.6 | 168 |
| 2.7 | 168 |
| 2.8 | 168 |
| 3.0 | 168 |
| 3.1 | 168 |
| 3.2 | 168 |
| 3.3 | 168 |
| 3.4 | 168 |
| 3.5 | 168 |
| 3.6 | 168 |
| 3.7 | 168 |
| 3.8 | 168 |
| 3.9 | 168 |
| 4.0 | 168 |
| 4.1 | 168 |
| 4.2 | 168 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| broker / durability | 168 | Keep the default 7-day retention. For durability workloads, longer retention means a broader recovery window if a consumer falls behind or a downstream system needs replay. Do not reduce retention below your RTO/RPO requirements. |
| broker / cost | 24 | Reducing retention from 7 days to 24 hours cuts disk usage by 7x for constant-throughput topics. Most real-time consumers catch up within minutes; a 24h window provides ample replay buffer without hoarding a week of data. |
Related Configs
log.segment.bytes · log.retention.bytes · log.cleanup.policy · log.retention.check.interval.ms · log.segment.delete.delay.ms
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.