process.env.UV_THREADPOOL_SIZE not working?
On linux your code works fine:
UV_THREADPOOL_SIZE = 1;
fs: 20
Request: 108
Hash: 817
Hash: 1621
Hash: 2399
Hash: 3175
UV_THREADPOOL_SIZE = 5
fs: 11
Request: 120
Hash: 836
Hash: 857
Hash: 859
Hash: 871
If you're using windows, instead of setting it inside your javascript file, you have to set it before calling the script.
set UV_THREADPOOL_SIZE=1 & node app.js
The easiest solution for me was just to add a npm script entry like so:
{
...
"main": "app.js",
"scripts": {
"start": "set UV_THREADPOOL_SIZE=2 & node app.js"
},
...
}
And then, in the cmd:
npm run start