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`); 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) for (let i = 0; i < workerCount; ++ i)
cluster.fork(); cluster.fork();
} }
+3 -3
View File
@@ -25,21 +25,21 @@ options = {
REDIS_HOST : {type : 'string', default : '127.0.0.1'}, REDIS_HOST : {type : 'string', default : '127.0.0.1'},
REDIS_DB : {type : 'int', default : 0}, REDIS_DB : {type : 'int', default : 0},
CWMP_WORKER_PROCESSES : {type : 'int', default : 4}, CWMP_WORKER_PROCESSES : {type : 'int', default : 0},
CWMP_PORT : {type : 'int', default : 7547}, CWMP_PORT : {type : 'int', default : 7547},
CWMP_INTERFACE : {type : 'string', default : '0.0.0.0'}, CWMP_INTERFACE : {type : 'string', default : '0.0.0.0'},
CWMP_SSL : {type : 'bool', default : false}, CWMP_SSL : {type : 'bool', default : false},
CWMP_LOG_FILE : {type: 'path', default : ''}, CWMP_LOG_FILE : {type: 'path', default : ''},
CWMP_ACCESS_LOG_FILE : {type : 'path', default : ''}, CWMP_ACCESS_LOG_FILE : {type : 'path', default : ''},
NBI_WORKER_PROCESSES : {type : 'int', default : 2}, NBI_WORKER_PROCESSES : {type : 'int', default : 0},
NBI_PORT : {type : 'int', default : 7557}, NBI_PORT : {type : 'int', default : 7557},
NBI_INTERFACE : {type : 'string', default : '0.0.0.0'}, NBI_INTERFACE : {type : 'string', default : '0.0.0.0'},
NBI_SSL : {type : 'bool', default : false}, NBI_SSL : {type : 'bool', default : false},
NBI_LOG_FILE : {type: 'path', default : ''}, NBI_LOG_FILE : {type: 'path', default : ''},
NBI_ACCESS_LOG_FILE : {type : 'path', default : ''}, NBI_ACCESS_LOG_FILE : {type : 'path', default : ''},
FS_WORKER_PROCESSES : {type : 'int', default : 2}, FS_WORKER_PROCESSES : {type : 'int', default : 0},
FS_PORT : {type : 'int', default : 7567}, FS_PORT : {type : 'int', default : 7567},
FS_INTERFACE : {type : 'string', default : '0.0.0.0'}, FS_INTERFACE : {type : 'string', default : '0.0.0.0'},
FS_SSL : {type : 'bool', default : false}, FS_SSL : {type : 'bool', default : false},