Bird
0
0

Why does Kafka recommend setting num.io.threads to a value close to the number of available CPU cores for disk I/O optimization?

hard📝 Conceptual Q10 of 15
Kafka - Performance Tuning
Why does Kafka recommend setting num.io.threads to a value close to the number of available CPU cores for disk I/O optimization?
ATo minimize network traffic between brokers
BTo maximize parallel disk operations without causing CPU contention
CTo reduce the number of partitions per topic
DTo limit the maximum message size
Step-by-Step Solution
Solution:
  1. Step 1: Understand CPU and io thread relationship

    Setting io threads near CPU core count allows Kafka to use CPU efficiently for parallel disk I/O.
  2. Step 2: Avoid CPU contention

    Too many threads cause CPU contention; too few underutilize CPU. Matching cores balances performance.
  3. Final Answer:

    To maximize parallel disk operations without causing CPU contention -> Option B
  4. Quick Check:

    num.io.threads ~ CPU cores for balanced disk I/O [OK]
Quick Trick: Match io threads to CPU cores for best disk I/O [OK]
Common Mistakes:
  • Confusing disk I/O threads with network threads
  • Thinking it affects partitions or message size
  • Setting too many threads causing CPU overload

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes