[Mongrel] Cluster restart leaving orphaned processes?

Zed A. Shaw zedshaw at zedshaw.com
Thu Dec 7 15:44:14 EST 2006

On Thu, 7 Dec 2006 12:43:02 -0500
cleaner416 <cleaner416 at gmail.com> wrote:

> First off, a big thank you to Zed and the development team for  
> mongrel and mongrel cluster.   I've deployed it for two apps (through  
> an apache 2.2 proxy) and it's amazing how much snappier everything  
> is.   Previously we were using lighttpd and lighttpd-fastcgi proxying  
> through apache 2.0, which was turning into a hassle for lots of  
> reasons, most notably the ruby fcgi bindings.   I was shocked at how  
> easy everything was to get everything up and running with mongrel,  
> and found the documentation to be just what I needed - not more or less.

Awesome.  It's nice to hear people move to a simpler tech AND have it seem snappier for them.
> My only question is this: when I run mongrel_rails cluster::restart  
> or mongrel_rails cluster::stop/start the old processes do not get  
> killed off and I have to do it manually.  I've noticed this on 3  
> boxes, all running FC5 with user/group mongrel/mongrel.   Any ideas?

There is kind of a dumb race condition I've gotta fix this week where if you stop a mongrel process, but mongrel needs to wait on some threads to finish, and then start a new one, all hell breaks loose.

Check if this is the case by doing this:

1) Tail the mongrel.log in a window off to the side.
2) Start some requests or something that's common usage.
3) Stop mongrel and look for log messages saying that process is waiting on threads to finish.
4) Right away start a new mongrel to replace this one.  The .pid file gets wiped out by this, and since the previous process is waiting, the new process can't bind.
5) Once the original process dies you'll be in the situation you've got.

See if that's the problem.  If it is then hang on as I'm beefing up the start/stop logic to be a bit smarter about this.

> (Just as an aside, is there a gateway somewhere where I can search  
> this list?) 

Here's the mailman page, but otherwise you'll need to search it with google:


Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list