From bfacd568004144484bf05c7303e8b3f45c53e089 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Thu, 1 Dec 2016 17:02:40 +0100 Subject: [PATCH] Allow to use workers for transforming cartocss into mapnik XML --- config/environments/development.js.example | 4 ++++ config/environments/production.js.example | 4 ++++ config/environments/staging.js.example | 4 ++++ config/environments/test.js.example | 4 ++++ lib/cartodb/server_options.js | 1 + package.json | 2 +- 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/environments/development.js.example b/config/environments/development.js.example index b66ee4d3..6800d4c6 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -111,6 +111,10 @@ var config = { // Important: check the configuration of uv_threadpool_size to use suitable value poolSize: 8, + // Whether grainstore will use a child process or not to transform CartoCSS into Mapnik XML. + // This will prevent blocking the main thread. + useCartocssWorkers: false, + // Metatile is the number of tiles-per-side that are going // to be rendered at once. If all of them will be requested // we'd have saved time. If only one will be used, we'd have diff --git a/config/environments/production.js.example b/config/environments/production.js.example index d50eb1e4..41e2353d 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -105,6 +105,10 @@ var config = { // Important: check the configuration of uv_threadpool_size to use suitable value poolSize: 8, + // Whether grainstore will use a child process or not to transform CartoCSS into Mapnik XML. + // This will prevent blocking the main thread. + useCartocssWorkers: false, + // Metatile is the number of tiles-per-side that are going // to be rendered at once. If all of them will be requested // we'd have saved time. If only one will be used, we'd have diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 4449c847..170e5e5f 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -105,6 +105,10 @@ var config = { // Important: check the configuration of uv_threadpool_size to use suitable value poolSize: 8, + // Whether grainstore will use a child process or not to transform CartoCSS into Mapnik XML. + // This will prevent blocking the main thread. + useCartocssWorkers: false, + // Metatile is the number of tiles-per-side that are going // to be rendered at once. If all of them will be requested // we'd have saved time. If only one will be used, we'd have diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 8961019d..3c940ac6 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -104,6 +104,10 @@ var config = { // Important: check the configuration of uv_threadpool_size to use suitable value poolSize: 8, + // Whether grainstore will use a child process or not to transform CartoCSS into Mapnik XML. + // This will prevent blocking the main thread. + useCartocssWorkers: false, + // Metatile is the number of tiles-per-side that are going // to be rendered at once. If all of them will be requested // we'd have saved time. If only one will be used, we'd have diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index c5d5d41b..6d8575a7 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -70,6 +70,7 @@ module.exports = { }, datasource: global.environment.postgres, cachedir: global.environment.millstone.cache_basedir, + use_workers: rendererConfig.mapnik.useCartocssWorkers || false, mapnik_version: global.environment.mapnik_version, mapnik_tile_format: global.environment.mapnik_tile_format || 'png', default_layergroup_ttl: global.environment.mapConfigTTL || 7200 diff --git a/package.json b/package.json index 00432ea4..6d3c0833 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "step-profiler": "~0.3.0", "turbo-carto": "0.18.0", "underscore": "~1.6.0", - "windshaft": "2.6.2", + "windshaft": "2.6.3", "yargs": "~5.0.0" }, "devDependencies": {