Rolling restarts

3 views
Skip to first unread message

Wouter de Bie

unread,
Dec 8, 2009, 3:54:15 AM12/8/09
to Phusion Passenger Discussions
Hi all!

I was wondering if there is a way to do a rolling restart of passenger
threads? We're currently running a system that can't have any slow
requests. The current setup is Nginx with thins running behind them
and when we redeploy our application, we do a rolling restart of the
thins so the traffic coming in is still handled by the older version
of the application for a while, until all thins have been restarted.
Is there a way to do this in passenger? Next to that, is there a way
to force a restart, instead of waiting for the first request to come
in when a restart.txt was placed in /tmp?

Greetings,

Wouter

Stephen

unread,
Dec 12, 2009, 12:37:45 PM12/12/09
to Phusion Passenger Discussions
It probally depends on whether or not your using the smart thread
launcher or not - since thoose keep only one copy of rails in memory
for the entire application.

If your not then perhaps you could get away with a simple shell script
like -

for m in `/usr/bin/passenger-status | /bin/grep PID | awk {'print $2'}
`
do
kill $m;sleep 10;
done

I have not tested this but in theory that should find all the pids of
all the passenger threads and send a kill singal to one every ten
seconds.. Then new ones that spawn in their places would use the new
code base...
Reply all
Reply to author
Forward
0 new messages