udpcon
udpcon

Reputation: 53

Node.js Cluster module - Multiprocessing or Parallel Processing?

I built a Node.js application that is built up of smaller components (children worker processes) that all perform different tasks, “in parallel”. When the main program runs, it spawns the workers and they begin their work. I used Node.js’s cluster module to accomplish this.

Is this an example of multiprocessing or parallel processing, and why?

Upvotes: 0

Views: 381

Answers (1)

Waqar
Waqar

Reputation: 848

Clustering is better to say a load balancer rather than parallel processing. Node JS is single threaded, it means if you have 4 cores, it will use one regardless of available cores, that's fork mode, Clustering uses one node thread on all available cores, that's an optimized way of doing things and load balancing.

Upvotes: 1

Related Questions