简体   繁体   中英

Node.js, pm2, and sticky sessions – possible?

Is there a way to have sticky sessions with node module pm2 ? I'm aware that they were intentionally left out of node's internal cluster module, and so it might not be the best architecture choice with Node.js to begin with. However, in case of paused media streams, for example, it would be useful.

Like you I've been using pm2 and like it, but need something that supports sticky sessions.

This module does automatic clusterisation with Node's cluster module and maintains sticky sessions. At this point I'm not sure how to optimally use it with pm2, as I've only just now implemented it for the first time with my app. In my initial integration of it with pm2, I'm going to be limiting pm2 to one process, because the sticky-session module seems to do the clusterisation over available cpu's itself.

I'll return to add info here as I learn more about best use.

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