AdvancedPerformance
What is the effect of fsync on Kafka performance and when should you configure it?
Reference answer
By default, Kafka does NOT call fsync after every write — it relies on the OS page cache and OS-level background flush. This is safe because with RF=3 and acks=all, data is durable on multiple machines even if one crashes before flushing to disk. The probability of simultaneous power failure on all replicas is extremely low. Enabling flush.messages=1 or flush.ms very low dramatically reduces throughput (100-1000x slower). Only configure explicit fsyncs for single-broker setups or regulatory requirements. For production multi-broker clusters, rely on replication for durability, not fsync.
Expected key concepts: fsync, page cache, OS background flush, RF=3, acks=all, flush.messages, flush.ms, throughput, 100-1000x slower, single-broker, replication