From f8ce10718b4cf54a176d2939ed115d3e28a9af9a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 26 Sep 2013 20:37:10 -0700 Subject: [PATCH] set threadpool size for node v0.10.x - closes #2061 - refs mapbox/tm2#16 --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 8ab8c401c..a9f6f7ea7 100755 --- a/index.js +++ b/index.js @@ -1,5 +1,8 @@ #!/usr/bin/env node +// increase the libuv threadpool size to 1.5x the number of logical CPUs. +process.env.UV_THREADPOOL_SIZE = Math.ceil(Math.max(4, require('os').cpus().length * 1.5)); + var fs = require('fs'); var path = require('path'); // node v6 -> v8 compatibility