conduktor.io ↗

log.cleanup.policy — Kafka Broker Configuration

This config designates the retention policy to use on log segments. The "delete" policy (which is the default) will discard old segments when their retention time or size limit has been reached

Description

This config designates the retention policy to use on log segments. The "delete" policy (which is the default) will discard old segments when their retention time or size limit has been reached. The "compact" policy will enable log compaction, which retains the latest value for each key. It is also possible to specify both policies in a comma-separated list (e.g. "delete,compact"). In this case, old segments will be discarded per the retention time and size configuration, while retained segments will be compacted. An empty list means infinite retention - no cleanup policies will be applied and log segments will be retained indefinitely. Note that with remote storage enabled, local retention limits (log.local.retention.ms and log.local.retention.bytes) are still applied to local segments.

Default Values by Kafka Version

ComponentKafka version lineDocumented default
Broker0.8.1delete
Broker0.8.2delete
Broker0.9.0delete
Broker0.10.0delete
Broker0.10.1[delete]
Broker0.10.2delete
Broker0.11.0delete
Broker1.0delete
Broker1.1delete
Broker2.0delete
Broker2.1delete
Broker2.2delete
Broker2.3delete
Broker2.4delete
Broker2.5delete
Broker2.6delete
Broker2.7delete
Broker2.8delete
Broker3.0delete
Broker3.1delete
Broker3.2delete
Broker3.3delete
Broker3.4delete
Broker3.5delete
Broker3.6delete
Broker3.7delete
Broker3.8delete
Broker3.9delete
Broker4.0delete
Broker4.1delete
Broker4.2delete
Broker4.3delete
Broker4.4delete

Tuning Recommendation

Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.

ProfileProposalRationale and tradeoff
broker / durabilitydeleteSets the default cleanup policy; delete and compact have different retention semantics and topic overrides apply.

Tradeoff: Compaction retains the latest value per key rather than all history, and tombstones have their own retention window.

Reference · 2026-10-27

Related Configs

log.cleaner.io.max.bytes.per.second · log.retention.hours · log.retention.bytes · log.cleaner.enable · log.cleaner.threads · log.cleaner.min.cleanable.ratio · log.cleaner.dedupe.buffer.size

Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.