Perfomance & ScalingLesson 87Free preview
Cluster Module
This lesson is part of Node.js · All levels
Summary
This lesson discusses cluster modules that allow a single application to run on multiple processes to utilize the entire CPU core. Because they are single-threaded per process, clusters are a major way to increase server throughput. You'll learn primary/worker, connection scheduling, and dealing with dead workers. (Node.js)
Key points
- The cluster module runs one instance of an application in multiple processes (worker) on all cores.
- The parent process is called primary (formerly master); the rest is worker.
- The default method of deploying the connection is round-robin (OS on Linux).
- 'Exit') to know the worker is dead; primary should be immediately fork back.
- Use the graceful shutdown and wait for the connection to be complete before leaving.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.