FAQ
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Dashku at Jun 22, 2012 at 1:22 pm
    Hi,

    I'm trying to work on this problem. I have an npm that extends
    node-http-proxy to provide round-robin and sticky-sessions support, I built
    an option to use Redis as the persistent memory store so that you could use
    cluster, but there's a bug somewhere so I might need help fixing that. The
    default in-process memory option works fine.

    https://github.com/paulbjensen/satellite

    Regards,

    Paul Jensen
    On Tuesday, June 19, 2012 5:34:42 AM UTC+1, 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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Bradley Meck at Jun 22, 2012 at 3:08 pm
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Dhruvbird at Jun 25, 2012 at 5:28 am
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Dhruvbird at Jun 26, 2012 at 4:02 am
    Just saw the blog post introducing 0.8 and it seems that it's a conscious
    decision to leave sticky sessions out.
    On Sunday, June 24, 2012 10:28:17 PM UTC-7, dhruvbird wrote:

    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Ben Noordhuis at Jun 26, 2012 at 1:48 pm

    On Tue, Jun 26, 2012 at 6:02 AM, dhruvbird wrote:
    Just saw the blog post introducing 0.8 and it seems that it's a conscious
    decision to leave sticky sessions out.
    That's correct.

    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Bradley Meck at Jun 26, 2012 at 2:58 pm
    +1 for not including this, sticky sessions are painful when they become the
    least common denominator.
    On Tuesday, June 26, 2012 8:48:00 AM UTC-5, Ben Noordhuis wrote:
    On Tue, Jun 26, 2012 at 6:02 AM, dhruvbird wrote:
    Just saw the blog post introducing 0.8 and it seems that it's a conscious
    decision to leave sticky sessions out.
    That's correct.
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Isaac Schlueter at Jun 26, 2012 at 9:30 pm
    For sessions, I recommend using redis with redsess:
    https://github.com/isaacs/redsess
    On Tue, Jun 26, 2012 at 7:58 AM, Bradley Meck wrote:
    +1 for not including this, sticky sessions are painful when they become the
    least common denominator.

    On Tuesday, June 26, 2012 8:48:00 AM UTC-5, Ben Noordhuis wrote:
    On Tue, Jun 26, 2012 at 6:02 AM, dhruvbird wrote:
    Just saw the blog post introducing 0.8 and it seems that it's a
    conscious
    decision to leave sticky sessions out.
    That's correct.
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Dominic Tarr at Jun 27, 2012 at 2:54 am
    I understand that the cluster api works by passing a file descriptor
    to the worker process.

    is it possible pass a file descriptor after you have started reading from it?
    On Wed, Jun 27, 2012 at 9:30 AM, Isaac Schlueter wrote:
    For sessions, I recommend using redis with redsess:
    https://github.com/isaacs/redsess
    On Tue, Jun 26, 2012 at 7:58 AM, Bradley Meck wrote:
    +1 for not including this, sticky sessions are painful when they become the
    least common denominator.

    On Tuesday, June 26, 2012 8:48:00 AM UTC-5, Ben Noordhuis wrote:
    On Tue, Jun 26, 2012 at 6:02 AM, dhruvbird wrote:
    Just saw the blog post introducing 0.8 and it seems that it's a
    conscious
    decision to leave sticky sessions out.
    That's correct.
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Tim Dickinson at Mar 3, 2013 at 6:52 pm
    I read in the docs some place. I cant seems to find it again. Can anyone say anything about where information might be on this?
    On Tuesday, June 26, 2012 10:54:04 PM UTC-4, Dominic wrote:
    I understand that the cluster api works by passing a file descriptor

    to the worker process.



    is it possible pass a file descriptor after you have started reading from it?


    On Wed, Jun 27, 2012 at 9:30 AM, Isaac Schlueter wrote:

    For sessions, I recommend using redis with redsess:
    https://github.com/isaacs/redsess

    On Tue, Jun 26, 2012 at 7:58 AM, Bradley Meck wrote:

    +1 for not including this, sticky sessions are painful when they become the
    least common denominator.

    On Tuesday, June 26, 2012 8:48:00 AM UTC-5, Ben Noordhuis wrote:

    On Tue, Jun 26, 2012 at 6:02 AM, dhruvbird wrote:

    Just saw the blog post introducing 0.8 and it seems that it's a
    conscious
    decision to leave sticky sessions out.
    That's correct.
    --
    Posting guidelines:
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at

    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedJun 19, '12 at 4:34a
activeMar 3, '13 at 6:52p
posts10
users7
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase