NodeJS cluster not using round robin (Developing on windows)

为君一笑 提交于 2020-01-07 04:14:33

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/43971263/nodejs-cluster-not-using-round-robin-developing-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!