Worker count defaults to CPU core count
This commit is contained in:
1 parent
0097a75cab
commit
5aec919a4e
2 files changed
+6
-3
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user