A page cache is operating-system memory that temporarily holds file data. Kafka writes incoming records there instead of forcing an immediate disk write, allowing sequential access patterns to remain fast while the operating system persists data in the background. section 6.3 section 8.5
A Kafka write typically follows this path:
- A producer sends a record to the broker. section 8.5
- The broker places the record in the operating system’s page cache; network threads queue requests for I/O threads. section 8.5
- The broker may acknowledge the producer after the record reaches main memory and, with replication configured, after followers receive it. section 6.3 section 8.5
- The operating system later flushes cached data to storage. section 6.3
A replicated write
A producer sends a record to a Kafka leader. The leader places it in the page cache and can acknowledge it before an immediate disk write. If followers replicate the record, that replication—not instant local disk persistence—provides the main protection against a single broker failure. A power failure can still lose data held only in memory, while simultaneous failures across brokers can cause permanent loss. section 6.3 section 8.5
The same data format can enable Linux zero-copy transfer: the kernel changes pointers rather than copying data between network memory and the page cache. TLS introduces additional processing and prevents this optimization. A full storage volume is especially dangerous because cached data may be lost; monitoring capacity and stopping Kafka before exhaustion are safer operational practices. section 6.3 section 16.1.3
