# Mongrel\_rails start and restart differences

**URL:** <https://www.ruby-forum.com/t/mongrel-rails-start-and-restart-differences/154646>\
**Category:** Mongrel\
**Created:** [December 2, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/mongrel-rails-start-and-restart-differences/154646 "2008-12-02T16:15:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [December 2, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/mongrel-rails-start-and-restart-differences/154646/1 "2008-12-02T16:15:17Z")

</div>

Hello everyone.

I’ve got a rails application that is using 3 mongrels that sit behind  
nginx. I’m monitoring the mongrels, nginx and mysql with Munin and I’m  
restarting the processes when they hit certain levels with God.

Can someone shed some light on this for me.

I’m starting the mongrels off with this command, looping through 3  
ports.

mongrel\_rails start -d -e production -a 127.0.0.1 -c  
/var/www/rails/daughter/current -p #{port} -P  
/var/www/conf/log/mongrel.#{port}.pid -l  
/var/www/conf/log/mongrel.#{port}.log.

If my mongrels start chewing up too much memory I restart them like so

mongrel\_rails restart -P /var/www/conf/log/mongrel.#{port}.pid

All works well. The problem is that munin does not record the mongrel  
after it’s been restarting as the restarted mongrel runs underneath a  
ruby process as opposed to a mongrel\_rail process.

Here’s what ps aux | grep mongrel\_rails outputs after one mongrel has  
restarted.

/USR/BIN/RUBY1.8 /USR/BIN/MONGREL\_RAILS START -D -E PRODUCTION -A  
127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5001 -P  
/VAR/WWW/CONF/LOG/MONGREL.5001.PID -L /VAR/WWW/CONF/LOG/MONGREL.5001.LOG

RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL\_RAILS START  
-D -E PRODUCTION -A 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5000  
-P /VAR/WWW/CONF/LOG/MONGREL.5000.PID -L  
/VAR/WWW/CONF/LOG/MONGREL.5000.LOG

I’ve capitalised them all so don’t worry about the switches, any ideas  
why mongrel\_rails start does this

/USR/BIN/RUBY1.8 /USR/BIN/MONGREL\_RAILS START

but mongrel\_rails restart does this  
RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL\_RAILS START

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [December 2, 2008, 8:18pm UTC](https://www.ruby-forum.com/t/mongrel-rails-start-and-restart-differences/154646/2 "2008-12-02T20:18:01Z")

</div>

On Tue, Dec 2, 2008 at 7:15 AM, Matt D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> after it’s been restarting as the restarted mongrel runs underneath a  
> -D -E PRODUCTION -A 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5000

I have you tried mongrel\_cluster\_restart ?

You can define a config file which says how many servers to startup,  
and what port # to start at (ie: 9000).  
You can also do a --clean to remove old pid files.

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)
