Standalone node scripts require clustering?

I have a node autonomous working for data processing. Depending on the capabilities of my server, I will run several instances of the worker, so my question is: should clustering be included in my worker, because the main task of clustering is to use several processor cores, but it is true only if we serve HTTP requests.

But in my case, if I run 4 instances, and then each instance will follow the clustering, so I believe that it is not recommended to use clustering for stand-alone scripts

+4
source share
1 answer

In this case, the built-in cluster module is useful, but certainly not needed. If you have some kind of queue from which each instance can get out of the conflict without conflict, then you are probably already working as well as you can.

If you want to manage / perform work for subsidiary workers, you can use the cluster module to start auxiliary processes and distribute tasks from the main process.

0
source

All Articles