John
John

Reputation: 480

NodeJS cluster not using round robin (Developing on windows)

Hi im currently developing a MEAN stack project and i found out the nodejs cluster module which is recommended before you deploy the the project.

I've applied it and done some ApacheBenchmark, the thing is, it's only responding to 1 worker, it's not rotating around my other 7 workers.

I've google about this and yeah windows default can't do round-robin, but is there a way to enable round-robin in windows?

Thank you!

Upvotes: 2

Views: 3219

Answers (1)

mscdex
mscdex

Reputation: 106698

In node v4.x and newer you can set the default scheduling policy by setting cluster.schedulingPolicy or by setting the NODE_CLUSTER_SCHED_POLICY environment variable. However, as the documentation describes, round-robin scheduling is disabled by default on Windows for performance reasons.

Upvotes: 6

Related Questions