Hey y''all: I''ve added some new stuff to mongrel_cluster. Give it try and let me know if it works for you. * Added ''--clean'' to cluster::start to force removal of the pidfile before trying to start the cluster member. This is useful for recovering from unexpected process death. * Added ''--only PORT'' to cluster::* to support running a command on a single cluster member identified by its port number (eg, 8001). Inspired by Kaspar Schiess. * Added cluster::status to display basic process status information for the cluster. Returns ''0'' if all processes are found and ''2'' if a process or pidfile is missing. Supports ''--only''. Status commands were also added to the init.d script, mongrel_cluster_ctl, and the cap recipes. * The init.d script (resources/mongrel_cluster) will now create /var/run/mongrel_cluster and chown to a defined user on start. To fully use this feature, update your cluster yml files to store the pidfile in /var/run/mongrel_cluster. This will support cleaning up orphaned pidfiles at boot time. For example: pid_file: /var/run/mongrel_cluster/foo.pid * Fixed a parameter bug with mongrel_cluster_ctl calling mongrel_rails. How would you use some of these new features? Lets pretend that your blog gets spammed by 3000+ comments and 2000+ trackbacks pushing your process memory usage to 300mb+. The fair and just Linux kernel, displeased by your actions, smites one of your processes using the all powerful oom-killer. How do you recover? $ mongrel_rails cluster::status Checking 2 Mongrel servers... Found dog: 8000 Lost dog: 8001 $ mongrel_rails cluster::start --only 8001 --clean Cleaning 1 pid file... Starting 1 Mongrel server... $ mongrel_rails cluster::status Checking 2 Mongrel servers... Found dog: 8000 Found dog: 8001 I''m open to suggestions for some different ''status'' output. Let me know if I broke anything. Install with: sudo gem install mongrel_cluster --source http://mongrel.rubyforge.org/releases/ Thanks, Bradley Taylor Rails Machine http://railsmachine.com
On Jan 26, 2007, at 12:10 AM, Bradley Taylor wrote:> Hey y''all: > > I''ve added some new stuff to mongrel_cluster. Give it try and let me > know if it works for you. > > * Added ''--clean'' to cluster::start to force removal of the pidfile > before trying to start the cluster member. This is useful for > recovering > from unexpected process death.Oh this is absolutely fantastic. It actually turns out to be exactly what I needed today. We can''t go 24 hours without ferret segfaulting mongrel on the most completely random searches ever - and the change to mongrel 1.0.1 from 0.3.13.4 seems to leave the pids laying around more. The --clean seems to be working great in my monit-initiated restarts (in production mind you :-) ) and now I can happily ignore trying to find the segfault needle in the ferret haystack again(*) Thanks Bradley! Jason (* yes I know it''s completely lazy to ignore this. But a) laziness is a require virtue of systems management and b) trying to find a random segfault in thousands of lines of C code is no longer fun to me ;-) ) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jason Young -- Systems Manager, eXtension http://about.extension.org/wiki/Jason_Young ______________________________________
Charles Brian Quinn
2007-Jan-26 19:25 UTC
[Mongrel] [ANN] mongrel_cluster 0.2.2 prerelease
Bradley, I agree, thanks for this. A hard rebooted box failed to start mongrel up -- and this should help out quite nicely. Thank you. Now I owe you like 28 beers. On 1/26/07, Jason Young <jason.young at extension.org> wrote:> > On Jan 26, 2007, at 12:10 AM, Bradley Taylor wrote: > > > Hey y''all: > > > > I''ve added some new stuff to mongrel_cluster. Give it try and let me > > know if it works for you. > > > > * Added ''--clean'' to cluster::start to force removal of the pidfile > > before trying to start the cluster member. This is useful for > > recovering > > from unexpected process death. > > Oh this is absolutely fantastic. It actually turns out to be exactly > what I needed today. We can''t go 24 hours without ferret segfaulting > mongrel on the most completely random searches ever - and the change > to mongrel 1.0.1 from 0.3.13.4 seems to leave the pids laying around > more. > > The --clean seems to be working great in my monit-initiated restarts > (in production mind you :-) ) and now I can happily ignore trying to > find the segfault needle in the ferret haystack again(*) > > Thanks Bradley! > Jason > > (* yes I know it''s completely lazy to ignore this. But a) laziness > is a require virtue of systems management and b) trying to find a > random segfault in thousands of lines of C code is no longer fun to > me ;-) ) > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Jason Young -- Systems Manager, eXtension > http://about.extension.org/wiki/Jason_Young > ______________________________________ > > > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com main: 678.389.9462 fax: 678.826.0969 Ruby on Rails Bootcamp at the Big Nerd Ranch Intensive Ruby on Rails Training: http://www.bignerdranch.com/classes/ruby.shtml
Um, I just looked at the new mongrel_cluster control file for init.d
and noticed that the
restart and status options are the same thing.
restart)
mongrel_cluster_ctl restart -c $CONF_DIR
RETVAL=$?
;;
status)
mongrel_cluster_ctl restart -c $CONF_DIR
RETVAL=$?
;;
Need to change the status command to, well status...
On 1/26/07, Charles Brian Quinn <me at seebq.com>
wrote:> Bradley, I agree, thanks for this.
>
> A hard rebooted box failed to start mongrel up -- and this should help
> out quite nicely.
>
> Thank you. Now I owe you like 28 beers.
>
> On 1/26/07, Jason Young <jason.young at extension.org> wrote:
> >
> > On Jan 26, 2007, at 12:10 AM, Bradley Taylor wrote:
> >
> > > Hey y''all:
> > >
> > > I''ve added some new stuff to mongrel_cluster. Give it
try and let me
> > > know if it works for you.
> > >
> > > * Added ''--clean'' to cluster::start to force
removal of the pidfile
> > > before trying to start the cluster member. This is useful for
> > > recovering
> > > from unexpected process death.
> >
> > Oh this is absolutely fantastic. It actually turns out to be exactly
> > what I needed today. We can''t go 24 hours without ferret
segfaulting
> > mongrel on the most completely random searches ever - and the change
> > to mongrel 1.0.1 from 0.3.13.4 seems to leave the pids laying around
> > more.
> >
> > The --clean seems to be working great in my monit-initiated restarts
> > (in production mind you :-) ) and now I can happily ignore trying to
> > find the segfault needle in the ferret haystack again(*)
> >
> > Thanks Bradley!
> > Jason
> >
> > (* yes I know it''s completely lazy to ignore this. But a)
laziness
> > is a require virtue of systems management and b) trying to find a
> > random segfault in thousands of lines of C code is no longer fun to
> > me ;-) )
> > --
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Jason Young -- Systems Manager, eXtension
> > http://about.extension.org/wiki/Jason_Young
> > ______________________________________
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Mongrel-users mailing list
> > Mongrel-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/mongrel-users
> >
>
>
> --
> Charles Brian Quinn
> self-promotion: www.seebq.com
> highgroove studios: www.highgroove.com
> slingshot hosting: www.slingshothosting.com
> main: 678.389.9462 fax: 678.826.0969
>
> Ruby on Rails Bootcamp at the Big Nerd Ranch
> Intensive Ruby on Rails Training:
> http://www.bignerdranch.com/classes/ruby.shtml
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
Nice catch! I''ll fix for the next one. I think there are too many ways to do the same thing! (mongrel_rails cluster::, mongrel_cluster_ctl, capistrano, init.d/mongrel_cluster). Thanks, Bradley Joey Geiger wrote:> Um, I just looked at the new mongrel_cluster control file for init.d > and noticed that the > restart and status options are the same thing. > > > restart) > mongrel_cluster_ctl restart -c $CONF_DIR > RETVAL=$? > ;; > status) > mongrel_cluster_ctl restart -c $CONF_DIR > RETVAL=$? > ;; > > Need to change the status command to, well status...