Use cluster2 for clustering (see #33)

This commit is contained in:
Sandro Santilli 2012-09-28 13:05:49 +02:00
parent 1601a02517
commit 8bd3b491d0

View File

@ -7,7 +7,7 @@
* environments: [development, production] * environments: [development, production]
*/ */
var cluster = require('cluster'); var Cluster = require('cluster2');
// sanity check // sanity check
var ENV = process.argv[2] var ENV = process.argv[2]
@ -34,12 +34,19 @@ var cartoData = require('./lib/cartodb/carto_data');
var Windshaft = require('windshaft'); var Windshaft = require('windshaft');
var serverOptions = require('./lib/cartodb/server_options'); var serverOptions = require('./lib/cartodb/server_options');
ws = CartodbWindshaft(serverOptions); var ws = CartodbWindshaft(serverOptions);
cluster(ws)
.use(cluster.logger('logs')) //.use(cluster.logger('logs'))
.use(cluster.stats()) //.use(cluster.stats())
.use(cluster.pidfiles('pids')) //.use(cluster.pidfiles('pids'))
.set('workers', 1) var cluster = new Cluster({
.listen(global.environment.port, global.environment.host); port: global.environment.port,
monPort: global.environment.port+1,
noWorkers: 1 // .set('workers', 1)
});
cluster.listen(function(cb) {
cb(ws);
});
console.log("Windshaft tileserver started on port " + global.environment.port); console.log("Windshaft tileserver started on port " + global.environment.port);