Add sticky session support to Node.js cluster module
$30-100 USD
Abgesagt
Veröffentlicht vor etwa 10 Jahren
$30-100 USD
Bezahlt bei Lieferung
Node.js has a cluster module that which forks a node process for each available CPU.
It therefore allows multiple workers to listen on the same port.
However, there is no sticky session support, so some applications may not work with it. If one worker gets request #1, the second worker may not understand what to do with request #2 from the same session.
The purpose of this project is to extend the cluster module to provide round-robin and sticky-sessions support. All requests for the same session should go to the same worker. Some possible way to do this:
1. Use a session store that is transactional and shared (redis etc.) and store where a session should be forwarded to.
2. Use a hashing method that will consistently point to the same location/worker for the same session (session could be ip/user/etc.), if the wrong worker gets the connection, forward it to the original worker.
3. Using a cookie to track browser.
There already is a module called satellite that does something similar. It extends http-node-proxy to provide round-robin and sticky session support. But it has bugs.
Module should be well-documented and easy to integrate with existing node programs to be able to load balance them. It should be packaged ready for npm.
Hi there, I think the best and easiest solution is 1, we don't have to extend the cluster module, just use an other session storage instead of memory. Let me help you doing that. Thanks