Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Graceful rolling restart with Passenger and Capistrano?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
casey  
View profile  
 More options Dec 17 2008, 12:40 am
From: casey <cassidyfor...@gmail.com>
Date: Tue, 16 Dec 2008 21:40:08 -0800 (PST)
Local: Wed, Dec 17 2008 12:40 am
Subject: Graceful rolling restart with Passenger and Capistrano?
I recently switched from a cluster of servers running Thin to a
cluster running Apache+Passenger.  I'm using haproxy to load-balance
across my machines.

I used to be able to redeploy/restart my application while it was
"hot" without affecting any of the users. It worked like so:

* capistrano deploy, the running Thin instances would continue to use
the old version of the app
* gracefully shut down Thins and then restart them one group at a
time. They would go down after completing current requests and come
back up with the new version of the app.

I'm having trouble doing this with Passenger because deploying new
code (which changes symlinks to myapp/current) seems to trigger
Passenger to restart. Is this normal behavior?

I'd be happy just restarting httpd to reload as long as I knew that
stopping Apache would gracefully shutdown Passengers.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Cheail  
View profile  
 More options Dec 17 2008, 12:54 am
From: Dan Cheail <dan.che...@me.com>
Date: Wed, 17 Dec 2008 16:54:11 +1100
Local: Wed, Dec 17 2008 12:54 am
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
Casey:

My experience with passenger is that any currently running processes  
will continue to run even after a re-start has been triggered; my  
users have never noticed downtime, even when doing several repeated  
deploys. I have noticed occaions where i've got live passengers of  
different versions, but all processes went to the most recent  
versions, and the old passenger instances eventually died out anyway.

--
Dan Cheail
Chief Geek, Codeape.
phone: 0402 114 697
web: http://codeape.net

On 17/12/2008, at 4:40 PM, casey wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amos  
View profile  
 More options Dec 17 2008, 2:31 pm
From: amos <famosea...@gmail.com>
Date: Wed, 17 Dec 2008 11:31:24 -0800 (PST)
Local: Wed, Dec 17 2008 2:31 pm
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
we had to switch to rolling restarts in capistrano in order to avoid
downtime. word is the passenger guys are working on a fix.

On Dec 16, 9:54 pm, Dan Cheail <dan.che...@me.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
casey  
View profile  
 More options Dec 18 2008, 12:12 am
From: casey <cassidyfor...@gmail.com>
Date: Wed, 17 Dec 2008 21:12:25 -0800 (PST)
Local: Thurs, Dec 18 2008 12:12 am
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
So you deploy to one server at a time instead of letting capistrano
deploy to all at once?

I just tried another deploy (under load) and had an outage again - it
seems that Passenger does *something* when "current" symlink is moved
and doesn't recover properly when under load.

On Dec 17, 2:31 pm, amos <famosea...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amos  
View profile  
 More options Dec 18 2008, 4:39 pm
From: amos <famosea...@gmail.com>
Date: Thu, 18 Dec 2008 13:39:46 -0800 (PST)
Local: Thurs, Dec 18 2008 4:39 pm
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
yes, in my experience passenger can't handle replacing the symlink
under load which is why we use 'httpd restart'.

we wrote a special capistrano hook to restart a server, wait 20
seconds and go onto the next. unfortunately, now it takes forever to
deploy new versions of our code.

On Dec 17, 9:12 pm, casey <cassidyfor...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
casey  
View profile  
 More options Dec 20 2008, 12:21 am
From: casey <cassidyfor...@gmail.com>
Date: Fri, 19 Dec 2008 21:21:38 -0800 (PST)
Local: Sat, Dec 20 2008 12:21 am
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
Thanks very much amos,

It was good to know that I'd have to solve the problem myself.  I
ended up doing something similar. For each server in my cluster,
Capistrano...

* Deletes a file that my load balancer (HAProxy) is looking for from /
public which causes it to be removed from rotation
* Waits 5 seconds for any requests to finish
* Regular capistrano update
* Put the /public/file back so that the server goes back into rotation
* Wait 20 seconds for Passenger to warm up, then move on

On Dec 18, 4:39 pm, amos <famosea...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
casey  
View profile  
 More options Dec 20 2008, 12:23 am
From: casey <cassidyfor...@gmail.com>
Date: Fri, 19 Dec 2008 21:23:21 -0800 (PST)
Local: Sat, Dec 20 2008 12:23 am
Subject: Re: Graceful rolling restart with Passenger and Capistrano?
oops - forgot the important part - an Apache restart after the Cap
update. I touch Passenger's restart.txt but there are no requests
coming in and these Apaches are dedicated to passenger, might as well
start fresh.

On Dec 20, 12:21 am, casey <cassidyfor...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google