Worker count defaults to CPU core count

This commit is contained in:
Zaid Abdulla committed 2017-02-19 15:06:49 -08:00
1 parent 0097a75cab
commit 5aec919a4e
2 files changed
+6 -3

No files matched your search

+3
View File
@@ -117,6 +117,9 @@ function start(service) {
let workerCount = config.get(`${service.toUpperCase()}_WORKER_PROCESSES`);
if (!workerCount)
workerCount = Math.max(2, require("os").cpus().length);
for (let i = 0; i < workerCount; ++ i)
cluster.fork();
}