# Upgrade without downtime?

**URL:** <https://www.ruby-forum.com/t/upgrade-without-downtime/112015>\
**Category:** Deployment\
**Created:** [August 14, 2007, 10:49am UTC](https://www.ruby-forum.com/t/upgrade-without-downtime/112015 "2007-08-14T10:49:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![piet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@piet](https://www.ruby-forum.com/u/piet)\
**Post date:** [August 14, 2007, 10:49am UTC](https://www.ruby-forum.com/t/upgrade-without-downtime/112015/1 "2007-08-14T10:49:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![piet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@piet](https://www.ruby-forum.com/u/piet)\
**Post date:** [August 14, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/upgrade-without-downtime/112015/2 "2007-08-14T19:45:45Z")

</div>

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  
– removed\_email\_address@domain.invalid  
– Engine Y., Serious Rails Hosting  
– (866) 518-YARD (9273)

---

<div class="post-metadata">

**Author:** ![piet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@piet](https://www.ruby-forum.com/u/piet)\
**Post date:** [August 14, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/upgrade-without-downtime/112015/3 "2007-08-14T20:15:48Z")

</div>

On 8/14/07, Ezra Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![piet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@piet](https://www.ruby-forum.com/u/piet)\
**Post date:** [August 14, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/upgrade-without-downtime/112015/4 "2007-08-14T20:23:49Z")

</div>

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

> On 8/14/07, Ezra Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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  
– removed\_email\_address@domain.invalid  
– Engine Y., Serious Rails Hosting  
– (866) 518-YARD (9273)
