Apache Kafka Streaming (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
Kafka Broker Socket Request Handlers: Acceptor thread, network processor threads, and I/O worker threads.
senior LevelSystem DesignApache KafkaMicroservices
In Simple Words: Understanding Kafka's low-level multi-threaded network model:
- Acceptor Thread (1 per port): Accepts new incoming TCP connections from clients and delegates the socket to a Network Thread in a round-robin pool.
- Network Threads (
num.network.threads = 8): Reads incoming request frames from client sockets, places them onto the Request Queue, and writes outgoing responses back to sockets. - I/O Threads (
num.io.threads = 16): Worker threads that pull requests from the Request Queue, perform local disk reads/writes or memory page cache operations, and push results to the Response Queue.