-1

The head is fairly self explanatory :)

Node supports process clustering (documentation). But in the documentation I failed to see what algorithm does it use to distribute work to workers.

Is it round-robin? PM2 is using round robin afaik.

Rouz
  • 1,247
  • 2
  • 15
  • 37
  • The [How It Works](https://nodejs.org/api/cluster.html#cluster_how_it_works) part mentions round-robin, which is used by default, except on Windows. You might also want to check out [cluster.schedulingPolicy](https://nodejs.org/api/cluster.html#cluster_cluster_schedulingpolicy). – Teh Apr 10 '19 at 14:54
  • Thanks... I completely failed to see that part, and i was actually searching for it... Strange... thank you once again – Rouz Apr 10 '19 at 21:03
  • Converted my comment into a response as suggested by Stackoverflow – Teh Apr 11 '19 at 15:33

1 Answers1

1

Based on the How It Works part of the documentation, it is mentionned that Cluster uses round-robin by default on most platforms (except on Windows).

You might also want to check out cluster.schedulingPolicy for a list of available policies.

Teh
  • 2,767
  • 2
  • 15
  • 16