search

Home  >  Q&A  >  body text

node.js - Nodejs为后台的Web App如何保证服务的稳定性和高响应效率?

如题,我们公司是全栈JS开发,后台用的NodeJs。
听说NodeJs是单线程的,容易出现单点故障,而且不能充分使用机器的CPU。
那我们在选购云服务器的时候,是否应该“多买低配置机器”,而不是像PHP服务器那样“买一个高配置机器”?

阿神阿神2785 days ago653

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:34:18

    This article can help you understand

    http://f2e.souche.com/blog/no...

    reply
    0
  • 黄舟

    黄舟2017-04-17 15:34:18

    1. Single-threaded but can run multiple processes, it can be fully utilized. It depends on how many cores your machine has

    2. For online deployment, you can look at pm2. Generally speaking, node deployment is in master-slave mode. One master process has several sub-processes. For example, the one we use is older, forever, and the master is responsible for monitoring. , if the child process hangs, the master will restart it, and there will be no so-called single point of failure

    3. I haven’t deactivated the cloud server, so it’s not easy to answer

    reply
    0
  • Cancelreply