conduktor.io ↗

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 VersionDefault Value
0.7168
0.8.024 * 7
0.9.0168
0.10.0168
0.10.1168
0.10.2168
0.11.0168
1.0168
1.1168
2.0168
2.1168
2.2168
2.3168
2.4168
2.5168
2.6168
2.7168
2.8168
3.0168
3.1168
3.2168
3.3168
3.4168
3.5168
3.6168
3.7168
3.8168
3.9168
4.0168
4.1168
4.2168

Tuning Recommendation

ProfileRecommendedWhy
broker / durability168Keep 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 / cost24Reducing 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.