Skip to content
Kafka Is FunProgress

IntermediatePerformance

What is the OS page cache and why does it matter for Kafka performance?

Reference answer

The OS page cache is kernel-managed RAM that caches recently accessed file contents. Kafka's performance secret is that it never manages its own cache — it relies entirely on the page cache for 'hot' data reads. When a consumer reads recently produced messages, they're served from RAM (page cache) rather than disk. This makes Kafka's sequential I/O pattern as fast as memory access for recent data. For this reason, Kafka brokers should have large RAM, used mostly by the OS for page cache, not for JVM heap.

Expected key concepts: page cache, RAM, kernel, sequential I/O, memory access, JVM heap, hot data, file contents, caching, broker RAM