From fd9e5402e7974601401fec222334b23bcf2a93e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eir=C3=ADkur=20Hei=C3=B0ar=20Nilsson?= Date: Thu, 18 Jul 2013 00:58:15 +0000 Subject: [PATCH] Override cluster size with environment variable. It's such a common requirement for ops to have the final say over the clustering, that configurability should be built in IMHO. Just like CLUSTER_MASTER_REPL. Size is the most important setting for us, but the same argument might be used for other settings. --- cluster-master.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-master.js b/cluster-master.js index cb4f00e..6746acb 100644 --- a/cluster-master.js +++ b/cluster-master.js @@ -58,7 +58,7 @@ function clusterMaster (config) { onmessage = config.onMessage || config.onmessage - clusterSize = config.size || os.cpus().length + clusterSize = config.size || +process.env.CLUSTER_MASTER_SIZE || os.cpus().length minRestartAge = config.minRestartAge || minRestartAge