0. Start master and workers
- SIGHUP comes in
1. Send that information to, for example, half of the workers
2. This half should stop accepting connections and as soon as they
serve they last request they should exit
3. The master know when the workers start exiting gracefully and
starts new workers
4. When half of your workers have restarted you can do the same to
the others
Remember that you will have your workers possibly running different
code versions at the same so ensure this won't be a problem.
The half 1st, half later is just a strategy. You can do one by one
or anything other. Just don't notify all workers at the same time or
you might have them closed too fast for you to start new ones..
---
Diogo R.
> --
> Job Board: http://jobs.nodejs.org/ [1]
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [2]
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en [3]
>
>
> Links:
> ------
> [1] http://jobs.nodejs.org/
> [2]
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [3] http://groups.google.com/group/nodejs?hl=en?hl=en
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en [3]
Links:
------
[1] http://jobs.nodejs.org/
[2] https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
[3] 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 nod...@googlegroups.com
To unsubscribe from this group, send email to
There are other ways of doing it too. For example in a recent project
of mine, I start two node.js servers listening on different local
ports. Both are proxied to by Nginx in the same server{} stanza.
Basically I rarely need to restart Nginx but I _can_ restart one
nodejs server, then the other to get new code running.
I know this isn't using cluster like you asked, but extrapolating can
make this work for your use-case too. I'm afraid I don't know how to
do it with a single master process without downtime, but I'd be keen
on knowing if this is possible. I think Nginx can also be restarted
with zero downtime - so the hard problem is already solved - so that
is also an option (as well as making it serve your static content)
which means you can still get what you want.
In an older project of mine where we had 4 webservers, we load
balanced to each of them, but took one out of the load balancer at a
time to load new code. Again, no downtime but a different solution to
what you asked for. Maybe these have given you some ideas. :)
Let us know when you come to a solution you like!
Cheers,
Andy
--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/
-Karl Tiedt
-Karl Tiedt
Absolutely, nothing will come through to a dead server (which is the
point of this solution).
However, just blithly stopping a server may cause some requests to
fail (maybe this was an artifact of our system) but we found it useful
to take a server out of the lb, wait until zero requests were being
sent to it and then we knew we could restart it without anyone seeing
any problems. :) This could have been automated quite easily so it's
not really a problem - just an extra safety net. :)
You're probably right, but this was what we found in our environment.
Others may differ and playing with your own system will teach you what
you need to do. Hope that makes sense.
-Karl Tiedt
--
Att,
Alan Hoffmeister
--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to