简体   繁体   中英

Master-slave mode or cluster mode of Nodejs server with one-core CPU

是否可以仅使用一个CPU内核以主/从模式或集群模式构建nodejs服务器,以便在当前线程关闭时其他js模式也可以启动?

Yes, while using the core cluster module, you can spawn more children than cores. It is not recommended for regular use due context switching and the overhead incurred with new node processes.

However, if this is to load new code, an overall different approach is required. There are some existing modules that can assist with zero downtime reloads and they mostly proxy requests to new instances to perform the switch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM