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 ...

Get Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.