I’ve been thinking for a while about how to upgrade a running rails
installation without any downtime for the users.
Let’s say you fixed some bugs without doing any changes to the db schema
or anything that suddenly looks/works different and would spook the
users.
One path I’ve been thinking about: Let’s say you run 10 mongrels.
-Upgrade your rails installation (svn update or scp or whatever you’re
using)
-Notify whatever is doing the load balancing that 5 mongrels will be
stopped. (this is possible with HAProxy, which I’m most familiar with)
-Stop 5 mongrels
-Start those 5 mongrels again
-Notify the LB that the first (new) 5 mongrels are running again and
that the remaining (old) 5 mongrels will be stopped
-Restart the remaining 5 mongrels
-Notify the LB that all 10 mongrels are running again
To have less of an impact on the load per mongrel you could restart the
mongrels one at a time. But you get the basic picture.
Any comments on this ? Is there a better way ? Will this cause problems
?
How do other people do this ?
-Upgrade your rails installation (svn update or scp or whatever
To have less of an impact on the load per mongrel you could restart
the mongrels one at a time. But you get the basic picture.
Any comments on this ? Is there a better way ? Will this cause
problems ?
How do other people do this ?
Thanks in advance for your insights!
Piet.
If you use monit to control your mongrels it does a rolling restart.
By that I mean it gracefully restarts the mongrels one at a time.
With nginx or something in front this will be seamless to your users.
If you use monit to control your mongrels it does a rolling restart.
By that I mean it gracefully restarts the mongrels one at a time.
With nginx or something in front this will be seamless to your users.
Do you mean ‘monit -g mongrels restart all’ is a rolling restart?
If you use monit to control your mongrels it does a rolling restart.
By that I mean it gracefully restarts the mongrels one at a time.
With nginx or something in front this will be seamless to your users.
Do you mean ‘monit -g mongrels restart all’ is a rolling restart?
Yes. The monit command will return immediately and it will roll thru
the mongrels one at a time and restart them.