print libuv threadpool size in node js 8

后端 未结 1 1781
闹比i
闹比i 2021-01-15 21:55

This link purely specifies that libuv provides a thread pool which can be used to run user code and get notified in the loop thread. Its default size is 4, but

相关标签:
1条回答
  • 2021-01-15 22:09

    You shouldn't have spaces in your set command.

    set UV_THREADPOOL_SIZE=120 && node index.js
    

    Also you should start your Node.js program by invoking the start script:

    npm start
    

    Otherwise the environmental variable won't be set and you will continue to get undefined when accessing it in your code.

    If you are using Nodemon, you can ensure your npm script is invoked by running the command with an extra argument:

    nodemon --exec npm start
    
    0 讨论(0)
提交回复
热议问题