如题,我们公司是全栈JS开发,后台用的NodeJs。
听说NodeJs是单线程的,容易出现单点故障,而且不能充分使用机器的CPU。
那我们在选购云服务器的时候,是否应该“多买低配置机器”,而不是像PHP服务器那样“买一个高配置机器”?
黄舟2017-04-17 15:34:18
Single-threaded but can run multiple processes, it can be fully utilized. It depends on how many cores your machine has
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
I haven’t deactivated the cloud server, so it’s not easy to answer