Kafka hard
Kafka achieves massive throughput by leveraging the Linux `sendfile` system call. Which specific memory-to-memory copy operation does this architectural choice eliminate?
- A The copy from the CPU register file to the L1 Instruction Cache during deserialization.
- B The redundant copy from the 'Kernel Page Cache' to the 'Application User-Space Buffer' and back to the 'Kernel Socket Buffer'.
- C The copy of metadata from ZooKeeper RAM to the local disk during every fetch request.
- D The copy from the Network Interface Card (NIC) directly to the SSD controller without CPU intervention.
Answer: B. The redundant copy from the 'Kernel Page Cache' to the 'Application User-Space Buffer' and back to the 'Kernel Socket Buffer'.
Standard I/O requires moving data between kernel and user context, which involves expensive CPU cycles and memory bandwidth. Zero-copy allows the OS to transmit data directly from the disk-backed Page Cache to the network stack, drastically reducing CPU overhead and allowing Kafka to saturate network links.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?