[Mongrel] [ANN] Another mongrel_cluster prerelease

Bradley Taylor bradley at railsmachine.com
Wed Apr 11 14:48:50 EDT 2007

Michael A. Schoen wrote:

> Just a question: why does a cluster restart do a stop and a start, 
> rather than an actual restart on each Mongrel? A restart is "nicer", and 
> handles much better cases in which a Mongrel can't (or shouldn't) stop 
> immediately. 

Originally, "cluster::restart" called "mongrel_rails restart". 
Unfortunately, this is not reliable for major changes and doing 
stop/start is the only way to guarantee that code changes will be applied.

 From the mongrel code (rails.rb, line 164):
# Reloads Rails.  This isn't too reliable really, but it
# should work for most minimal reload purposes.  The only reliable
# way to reload properly is to stop and then start the process.

I don't think it is entirely true to say that restart is "nicer" than 
stop/start. 'stop' waits for the current request to finish unless you 
use --force. In the context of a cluster, other cluster members will 
handle requests during the stop/start cycle.

 > The current stop/start approach means that the start often
 > fails, because the stop hasn't actually shutdown the Mongrel yet.

It is possible that start will be called before the process is gone. 
I'll think about adding some sort of check in cluster::restart to verify 
the process is gone before calling start.

If your requests take a long time to complete, you might end up having 
other problems unless you have loads of ram and a million mongrels in 
your cluster.

 > Would it be possible to make doing an actual restart an option? Or
 > another command that does a true restart?

No, because it's unreliable.


More information about the Mongrel-users mailing list