- I have write a demo in nodejs like this:
hello.js:
var http = require(‘http’);
while(true){
console.log(process.env.UV_THREADPOOL_SIZE);
}
-
I monitor the process and threads with 'pstree -p | grep node' after starting the program above.
-
I have tried 3 ways to edit thread size but none of them works: 1) Set the paramters when starting: 'UV_THREADPOOL_SIZE=100 node hello.js' 2) add path in the etc/profile and reboot the system:export UV_THREADPOOL_SIZE=100 3) add 'process.env.UV_THREADPOOL_SIZE=100' in the code.
-
the results of the monitor are the same:
There is only 5 threads work in the node process (4 are work threads and 1 is loop thread)
My nodejs is v6.9.x. Have anyone used this successfully?
via Alex.Xing
No comments:
Post a Comment