Does the node clustering module provide hooks to achieve this (sticky 
sessions) or will I have to re-implement a bunch of things from scratch or 
copy-paste code?

On Friday, June 22, 2012 8:08:30 AM UTC-7, Bradley Meck wrote:
>
> There are a couple ways 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. Use a master/slave setup using fork rather than cluster. Master gets 
> all the connections incoming on a machine and processes them before 
> forwarding them to the proper worker.
>
> Each method has its advantages.
>
> The alternative to this is to change an API to be state-less, which can be 
> hard if connections are using multiple protocols.
>
> On Monday, June 18, 2012 11:34:42 PM UTC-5, dhruvbird wrote:
>>
>> Is it possible to have sticky sessions using the new cluster API? Some 
>> custom logic such as a cookie based solution? Something similar to nginx 
>> sticky module?
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to