Why is node.js not suitable for heavy CPU apps?

前端 未结 4 1990
故里飘歌
故里飘歌 2020-12-12 17:04

Node.js servers are very efficient concerning I/O and large number of client connection. But why is node.js not suitable for heavy CPU apps in comparison to a traditional mu

4条回答
  •  孤街浪徒
    2020-12-12 17:39

    Node is flawless if you are having asynchronous tasks because java script will run these things by worker pool. But if you run CPU intense tasks (where you heavily use CPU ) Ex you have a billion users and you want to sort those people on name. Its quit a Intense tasks, and this is synchronous which will block other code from running.

    So its not a good idea to use node for these kind of applications. Technically you can find alternatives to address those kind of tasks. The above example is better addressed in a Db. then passing that result is great.

    In the same way avoid Intense task and keep your CPU cool for better performance

提交回复
热议问题