Bird
0
0

Which Node.js module is commonly used to fork workers for each CPU core?

easy📝 Conceptual Q2 of 15
Node.js - Cluster Module
Which Node.js module is commonly used to fork workers for each CPU core?
Aos
Bhttp
Cfs
Dcluster
Step-by-Step Solution
Solution:
  1. Step 1: Identify the module for worker forking

    The 'cluster' module in Node.js is designed to create child processes (workers) that share the same server port.
  2. Step 2: Confirm other modules' roles

    'http' handles server requests, 'fs' handles file system, and 'os' provides system info but does not fork workers.
  3. Final Answer:

    cluster -> Option D
  4. Quick Check:

    Worker forking module = D [OK]
Quick Trick: Use 'cluster' module to fork workers per CPU core [OK]
Common Mistakes:
  • Confusing 'os' with 'cluster' for forking
  • Using 'http' to fork workers
  • Trying to fork workers with 'fs'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes