chore(cluster): set max #cores to 1 for now (we're maxing memory again)

This commit is contained in:
Tyler Renelle 2014-03-13 10:10:45 -06:00
parent 35708ccc9c
commit 3f5221755c

View file

@ -8,9 +8,11 @@ var logging = require('./logging');
var isProd = nconf.get('NODE_ENV') === 'production';
var isDev = nconf.get('NODE_ENV') === 'development';
// The max num of CPUs to enable with cluster. On heroku, our app is pretty beefy in memory, so we're knocking back to 1
var MAX_CORES = 1;
if (cluster.isMaster && (isDev || isProd)) {
// Fork workers.
_.times(_.min([require('os').cpus().length,2]), function(){
_.times(_.min([require('os').cpus().length,MAX_CORES]), function(){
cluster.fork();
});