From e0a7eb01ccfe7ff4c1d40eba961025c0946161c4 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Fri, 4 Sep 2015 16:33:40 +0200 Subject: [PATCH] Use torque renderer config Adds some notes about db pool params in torque --- config/environments/development.js.example | 10 ++++++++++ config/environments/production.js.example | 10 ++++++++++ config/environments/staging.js.example | 10 ++++++++++ config/environments/test.js.example | 10 ++++++++++ lib/cartodb/server_options.js | 1 + 5 files changed, 41 insertions(+) diff --git a/config/environments/development.js.example b/config/environments/development.js.example index c3401aa2..bf98ca23 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -162,6 +162,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/production.js.example b/config/environments/production.js.example index d251ac8e..386f4433 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -156,6 +156,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 5fe72c9e..f692d2ba 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -156,6 +156,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/test.js.example b/config/environments/test.js.example index f0002aa5..13132e9a 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -158,6 +158,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 4b2c595d..ac416d30 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -79,6 +79,7 @@ module.exports = function(redisPool) { }, renderer: { mapnik: rendererConfig.mapnik, + torque: rendererConfig.torque, http: rendererConfig.http }, redis: global.environment.redis,