strapio icon indicating copy to clipboard operation
strapio copied to clipboard

Usage with PM2

Open Reggionick opened this issue 3 years ago • 3 comments

Is there a way to use this module when Strapi is launched with PM2 on multiple instances?

Reggionick avatar Jul 23 '21 09:07 Reggionick

Don't quit understand. Its would be handled like strapi would handle it.

genjudev avatar Jul 24 '21 02:07 genjudev

When multiple instances of Strapi are instantiated on the client side you don't know to witch instance the request will be forwarded to. The Strapi APIs are stateless, but with Socket.IO a connection is established and the client should reach always the right worker. Here you can find the Socket.IO guide to configure it when PM2 is used (look at the third solution "use @socket.io/pm2")

Reggionick avatar Jul 24 '21 07:07 Reggionick

I would not program strapio to support pm2 directly. But strapio should have the ability to work with pm2 or other process managers.

genjudev avatar Sep 06 '21 14:09 genjudev