Creating an app cluster
One common argument against Node is that it is single-threaded and therefore does not perform well.
This argument is outdated and invalid—now Node comes with a module called cluster, using which we can run multiple processes of an app, essentially multiplying the performance of the app on multi-core machines, which most modern computers are.
The performance gain is more obvious when the app is processor- and memory-hungry, and is data-intensive. "Hello World" apps are likely to show little to no improvement in less stressful tests.
Note
The cluster module is still experimental, so the API may change in the future. But the module itself is likely to be there for good.
Let's write two sample apps to find out whether the performance ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access