Socket service pm2-I max deployment multi-process deployment, communication between processes

Boss:

my program is an instant messaging service of socket.io, and my program does not use cluster module to use cpu, so I think pm2 deployment uses pm2"s multi-input

program, but when I use it, I find that the method of pm2 is equivalent to starting several programs in cpu, so when the user speaks, only the user in the current kernel program can receive

.

to push, should I introduce redis to manage socket connections?

Dec.12,2021

this concurrent extension requires the program itself to be stateless. Your current situation is that if you want to start socket services in different processes, you need to share information between processes. In your current situation, adding a message server is a relatively simple way to solve the problem.

Menu