Network and I/O threads

Learn more about the configuration properties related to network and I/O threads.

Kafka brokers use network threads to handle client requests. Incoming requests (such as produce and fetch requests) are placed into a requests queue from where I/O threads are taking them up and process them. After a request is processed, the response is placed into an internal response queue from where a network thread picks it up and sends response back to the client.

  • num.network.threads is an important cluster-wide setting that determines the number of threads used for handling network requests (that is, receiving requests and sending responses). Set this value mainly based on number of producers, consumers and replica fetchers.
  • queued.max.requests controls how many requests are allowed in the request queue before blocking network threads.
  • num.io.threads specifies the number of threads that a broker uses for processing requests from the request queue (might include disk I/O).