From d89b2986fdbaaae57f54ec8b861e9609027aae38 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 8 Oct 2014 16:50:35 +0200 Subject: [PATCH] Allow to add more node.js' threadpool workers via process.env.UV_THREADPOOL_SIZE --- NEWS.md | 3 +++ app.js | 4 ++++ config/environments/development.js.example | 1 + config/environments/production.js.example | 1 + config/environments/staging.js.example | 1 + config/environments/test.js.example | 1 + 6 files changed, 11 insertions(+) diff --git a/NEWS.md b/NEWS.md index 14f367f0..c973fd4e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ 1.18.1 -- 2014-mm-dd -------------------- +New features: + - Allow to add more node.js' threadpool workers via process.env.UV_THREADPOOL_SIZE + 1.18.0 -- 2014-10-03 -------------------- diff --git a/app.js b/app.js index c420ab61..0d946375 100755 --- a/app.js +++ b/app.js @@ -37,6 +37,10 @@ log4js_config = { replaceConsole:true }; +if (global.environment.uv_threadpool_size) { + process.env.UV_THREADPOOL_SIZE = global.environment.uv_threadpool_size; +} + if ( global.environment.log_filename ) { var logdir = path.dirname(global.environment.log_filename); // See cwd inlog4js.configure call below diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 59c9f6aa..d0ec046b 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -2,6 +2,7 @@ var config = { environment: 'development' ,port: 8181 ,host: '127.0.0.1' + ,uv_threadpool_size: undefined // Regular expression pattern to extract username // from hostname. Must have a single grabbing block. ,user_from_host: '^(.*)\\.localhost' diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 851671da..794f7dfc 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -2,6 +2,7 @@ var config = { environment: 'production' ,port: 8181 ,host: '127.0.0.1' + ,uv_threadpool_size: undefined // Regular expression pattern to extract username // from hostname. Must have a single grabbing block. ,user_from_host: '^(.*)\\.cartodb\\.com$' diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 1084f1e6..c07d17cb 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -2,6 +2,7 @@ var config = { environment: 'production' ,port: 8181 ,host: '127.0.0.1' + ,uv_threadpool_size: undefined // Regular expression pattern to extract username // from hostname. Must have a single grabbing block. ,user_from_host: '^(.*)\\.cartodb\\.com$' diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 2937f285..f91e36a4 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -2,6 +2,7 @@ var config = { environment: 'test' ,port: 8888 ,host: '127.0.0.1' + ,uv_threadpool_size: undefined // Regular expression pattern to extract username // from hostname. Must have a single grabbing block. ,user_from_host: '(.*)'