import * as cluster from 'cluster' if (cluster.isPrimary) { process.env.NODE_CLUSTER_SCHED_POLICY = 'none' console.log(`process.env.NODE_CLUSTER_SCHED_POLICY: ${process.env.NODE_CLUSTER_SCHED_POLICY}`) for (let index = 0; index < 2; index++) { cluster.fork() setTimeout(() => console.log(`cluster.schedulingPolicy: ${cluster.schedulingPolicy}`), 1000) } } else { setTimeout(() => null, 1000) }