log.flush.interval.messages — Kafka Broker Configuration
The number of messages accumulated on a log partition before messages are flushed to disk..
Description
The number of messages accumulated on a log partition before messages are flushed to disk.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.8.0 | 10000 |
| 0.8.1 | None |
| 0.8.2 | Long.MaxValue |
| 0.9.0 | 9223372036854775807 |
| 0.10.0 | 9223372036854775807 |
| 0.10.1 | 9223372036854775807 |
| 0.10.2 | 9223372036854775807 |
| 0.11.0 | 9223372036854775807 |
| 1.0 | 9223372036854775807 |
| 1.1 | 9223372036854775807 |
| 2.0 | 9223372036854775807 |
| 2.1 | 9223372036854775807 |
| 2.2 | 9223372036854775807 |
| 2.3 | 9223372036854775807 |
| 2.4 | 9223372036854775807 |
| 2.5 | 9223372036854775807 |
| 2.6 | 9223372036854775807 |
| 2.7 | 9223372036854775807 |
| 2.8 | 9223372036854775807 |
| 3.0 | 9223372036854775807 |
| 3.1 | 9223372036854775807 |
| 3.2 | 9223372036854775807 |
| 3.3 | 9223372036854775807 |
| 3.4 | 9223372036854775807 |
| 3.5 | 9223372036854775807 |
| 3.6 | 9223372036854775807 |
| 3.7 | 9223372036854775807 |
| 3.8 | 9223372036854775807 |
| 3.9 | 9223372036854775807 |
| 4.0 | 9223372036854775807 |
| 4.1 | 9223372036854775807 |
| 4.2 | 9223372036854775807 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| broker / throughput | 9223372036854775807 | Keep OS-controlled fsync (Long.MAX_VALUE = effectively never). Forcing periodic fsync (e.g., every 10000 messages) serializes all partition writes during the flush, creating latency spikes that halve throughput on HDD-backed brokers. Rely on replication for durability instead. |
| broker / durability | 1 | Forcing fsync on every message ensures page cache data is committed to disk before acknowledging the write, protecting against OS-level crashes (not just JVM crashes). Without this, the OS can hold up to seconds of unflushed writes in page cache. |
| broker / latency | 9223372036854775807 | Keep the default (OS-managed fsync). Forcing fsync per message (setting to 1) adds 1-10ms per produce but is unnecessary — Kafka replication already provides durability. OS page cache flush is sufficient for latency. |
Related Configs
log.flush.interval.ms · default.replication.factor · num.io.threads
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.