Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 image 658
Ville Avatar asked Feb 03 '14 02:02

Ville


1 Answers

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.

like image 195
Wylie Kulik Avatar answered Oct 19 '22 02:10

Wylie Kulik