node.js - NodeJS启动多实例问题
PHP中文网
PHP中文网 2017-04-17 16:14:21
0
3
342
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
大家讲道理
  • The problem you mentioned does not exist. When you talk about starting multiple instances, can I understand it as using multiple cores to start multiple processes? If so, then the processes on each core are independent of each other. As you said, nodejs is a single process. Each process on the core has its own map variable, which is independent of each other. A process can only access its own global variables and cannot access the map variables of a process on another core.

刘奇

You can use redis or MemCached for data sharing

大家讲道理

Not all instances can be accessed. An instance is equivalent to a container. If you put a variable in container a, the variable in a cannot be obtained in container b. Imagine two people ordering a milkshake. The milkshake is the same, but you add chocolate chips to your milkshake to make it taste better. So, can another person drink the chocolate beans? If you can please give me a Doraemon-like medicine

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template