Skip to content

Kafka 存储配置参考 ​

Topic 配置参数所属机制主要作用典型默认值
segment.bytesSegment日志分段大小1 GiB
segment.msSegment分段滚动时间7 天
segment.index.bytesIndex索引文件大小限制10 MiB
index.interval.bytesIndex稀疏索引字节间隔4096
max.message.bytesRecord Batch允许的最大消息批次大小约 1 MiB
compression.typeCompression日志压缩算法策略producer
flush.messagesFlush消息数量刷盘阈值Long.MAX_VALUE
flush.msFlush时间刷盘阈值Long.MAX_VALUE
cleanup.policyCleanup日志清理策略delete
retention.msRetention日志保留时间7 天
retention.bytesRetention单分区日志保留大小-1
delete.retention.msCompactionTombstone 保留时间24 小时
min.cleanable.dirty.ratioCompaction日志压缩清理比例阈值0.5
min.compaction.lag.msCompaction消息最短压缩等待时间0
file.delete.delay.msCleanup文件延迟删除时间60000

这些是常见默认值,实际 Topic 配置可能继承或覆盖 Broker 的默认配置。

相关入口 ​

参考资料 ​