Create a parameter for number of workers in cluster mode
gusostow opened this issue · comments
if (cluster.isMaster) {
for (let i = 0; i < numCPUs; i++) {
cluster.fork()
}
The number of workers in your cluster is bound by the amount of CPU your server/computer has. It's probably not wise to go beyond the CPU limit as I imagine its probably one thread per CPU.
My desire was to use fewer than my total CPUs
You can edit the file to use less than the total amount if CPUs and pass it in as a parameter.