Upgrade without downtime?

Hi List!

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 ?

Thanks in advance for your insights!

Piet.

Hi-

On Aug 14, 2007, at 1:47 AM, Piet H. wrote:

-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.

Cheers-
– Ezra Z.-- Founder & Ruby Hacker
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)

On 8/14/07, Ezra Z. [email protected] wrote:

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?


Alex

On Aug 14, 2007, at 11:15 AM, Alexey V. wrote:

On 8/14/07, Ezra Z. [email protected] wrote:

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.

Cheers-
– Ezra Z.
– Founder & Ruby Hacker
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)