Forum: Mongrel mongrel_rails start and restart differences

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E13ea23a8a7e852bc7bf1952dff3d7b8?d=identicon&s=25 Matt Davies (vanderkerkoff)
on 2008-12-02 16:15
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.
583d7d066b30d8d38df7d7c2e9e78045?d=identicon&s=25 Anthony Ettinger (Guest)
on 2008-12-02 20:18
(Received via mailing list)
On Tue, Dec 2, 2008 at 7:15 AM, Matt Davies <lists@ruby-forum.com>
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 Ettinger
408-656-2473
http://anthony.ettinger.name
This topic is locked and can not be replied to.