admin管理员组文章数量:1432384
If I understood correctly:
- by default nodejs provides a worker pool, whose size can be tuned with UV_THREADPOOL_SIZE (default: 4)
- a cpu or io intensive task can use thread from this worker pool (this is the case for node modules like DNS or Crypto) or create a dedicated worker pool
- total number of worker pools should not exceed the actual number of cpu capability of where the application is running
My questions:
- how do you track the actual number of workers being used by your application ?
- when using third party modules (for instance mongoose or JSONStream), one should be aware of those modules strategy (use of default worker pool or dedicated worker pool). Does that mean that for every module used one should look into the code to determine its strategy?
- the use of node cluster (for instance with pm2) seems that it complicates the fine tuning of the number of workers, and that it'd be better to just scale out. Your advice on this matter?
Thanks for your feedback
本文标签: nodejsNodejs worker pool fine tuningStack Overflow
版权声明:本文标题:node.js - Nodejs worker pool fine tuning - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745595009a2665424.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论