Forum: Rails deployment mongrel, logging, dying processes

0f50b9a2ad85666d537d39bda49327ee?d=identicon&s=25 Jonathan Rochkind (jrochkind)
on 2008-01-29 22:21
Hi. I'm deploying a Rails app via a mongrel cluster. I have some
confusion about logging in a mongrel environment.

Some of my mongrels seem to be dying unexpectedly. The .pid file is
still there, but the process isn't. However, when I look at the
mongrel.pid.log file for a mongrel that is no longer running--there's
nothing there to indicate why it died.

I'm confused as to what output ends up in the mongrel.pid.log vs what
ends up in production.log?  Can anyone clear up how this works?

When I look at the production.log -- I'm not sure if there's anything
there to indicate why the mongrel died. There's a whole lot of cruft in
the production log! In particular, there seem to be entries for every
single HTTP request, along with timing numbers. Is this actually useful
to have?  Is there any way to turn that kind of logging off? Do I want
to?

My own logger.info(message) or logger.debug(message) seem to be in
production.log too, instead of the mongrel.pid.log. That's to be
expected? I sort of expected that logger.info wouldn't be output in a
production environment at all!  And Rails-produced error messages and
deprecation warnings seem to end up in the mongrel.pid.log--why do my
own log messages end up in production.log instead? What controls what
goes where? Are there ways to fine-tune this more usefully?

And in addition to my logging questions, does anyone have any idea why
my mongrels might be silently dying?

Thanks for any advice,

Jonathan
75c5434f7f8f9e0408695b3a73fbbfa0?d=identicon&s=25 Kristopher Kelly (krisk)
on 2008-07-09 22:12
Jonathan Rochkind wrote:
> And in addition to my logging questions, does anyone have any idea why
> my mongrels might be silently dying?
>
> Thanks for any advice,
>
> Jonathan

I would love to know the answer to this, too, because I'm having the
exact same trouble. Anyone know if this has already been answered
elsewhere? This is an incredibly frustrating problem. Just some advice
on how to log what is going on would be useful....

Thanks,
Kris
583d7d066b30d8d38df7d7c2e9e78045?d=identicon&s=25 Anthony Ettinger (Guest)
on 2008-07-09 23:19
(Received via mailing list)
tail -f ./current/logs/mongrel.log

?

On Wed, Jul 9, 2008 at 1:12 PM, Kristopher Kelly
<ruby-forum-incoming@andreas-s.net> wrote:
> exact same trouble. Anyone know if this has already been answered
> elsewhere? This is an incredibly frustrating problem. Just some advice
> on how to log what is going on would be useful....
>
> Thanks,
> Kris
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>



--
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name
C381828d1907912eab30cbe38d5ea245?d=identicon&s=25 Aníbal Rojas (Guest)
on 2008-07-12 14:23
(Received via mailing list)
Jonathan,

On Jan 29, 5:21 pm, Jonathan Rochkind <ruby-forum-incom...@andreas-
s.net> wrote:
> Hi. I'm deploying a Rails app via a mongrel cluster. I have some
> confusion about logging in a mongrel environment.

If you were using thin of FastCGI the behaviour would be the same.

> Some of my mongrels seem to be dying unexpectedly. The .pid file is

Check log/production,log for unhandled exceptions.

> still there, but the process isn't. However, when I look at the

Yes, the PID will be left behind, restarting the process requires
cleaning it use:

--clean

http://paulgoscicki.com/archives/2008/03/mongrel_c...

> mongrel.pid.log file for a mongrel that is no longer running--there's
> nothing there to indicate why it died.

And you won't find it there, go to log/production.log

> I'm confused as to what output ends up in the mongrel.pid.log vs what
> ends up in production.log?  Can anyone clear up how this works?

mongrel.pid.log is specific to mongrel internals
production.log is used by rails itself, is where the meat is

> When I look at the production.log -- I'm not sure if there's anything
> there to indicate why the mongrel died. There's a whole lot of cruft in

Exceptions, any?

$ egrep '(ception|rror)' log/production.log

> the production log! In particular, there seem to be entries for every
> single HTTP request, along with timing numbers. Is this actually useful

Yes, this is the default behaviour of Rails logger.

> to have?  Is there any way to turn that kind of logging off? Do I want
> to?

Yes, youcan customize the logger output level to suit you needs, but I
find the dfault useful for troubleshooting.

> My own logger.info(message) or logger.debug(message) seem to be in
> production.log too, instead of the mongrel.pid.log. That's to be
> expected? I sort of expected that logger.info wouldn't be output in a

Yes, that is fine.

> production environment at all!  And Rails-produced error messages and

In all frameworks/loggers I used, in Java and Ruby, INFO is logged in
production environment, it is really useful for troubleshooting or
fine tuning the app response times.

> deprecation warnings seem to end up in the mongrel.pid.log--why do my

Deprecations are thrown by the MRI, not by the Rails app.

> own log messages end up in production.log instead? What controls what

Because those mesasages are added to the default logger initialized by
Rails calling logger.level and this logger is configured to generate
the log/MODE.log file.

> goes where? Are there ways to fine-tune this more usefully?

Sure, I would recommend The Rails Wayf rom Ovie, there you will
understand how Rails initializes, its relationship with webserves and
logging is also documented there.

> And in addition to my logging questions, does anyone have any idea why
> my mongrels might be silently dying?

Something is going wrong in you Rails app, maybe is a misbehaved
library, or code, Do you have a memory leak? Are there exception or
error in your logs?  What kind of hosting are you using? Shared? VPS?
How much memory? How many monmgrels are running? Are you using Monit
or God to tace care of the processes? Rails forensics requires a LOT
more information.

> Thanks for any advice,

Best regars and good luck,

--
Aníbal Rojas
http://hasmanydevelopers.com
http://rubycorner.com
http://anibal.rojas.com.ve
1489c676aa24c51b41fa09ffb9550118?d=identicon&s=25 Sathish Kumar (sathishkumar)
on 2008-07-13 05:20
(Received via mailing list)
Hi,
    I have some idea about why mongrel is dying sometimes/most of the
times.

    Mongrel can handle the 256 request simultaneously at one time. if
the
incoming request is higher than 256, they have written code inside the *
mongrel.rb* to increase the threads to handle the request. But they
forgot
to initialize the one variable called *'w'*(i'm not sure the exact
variable
name but its one word) so that its not creating the extra threads to
handle
request and its crashing.

mongrel gets crashed becasue of the error this is the exact error :
*unintialized
constant 'w'

*If you want to know about this please look into your log files which is
reside in log folder.

Thanks,
Sathish Kumar Sadhasivam.

On Thu, Jul 10, 2008 at 2:49 AM, Anthony Ettinger <ettinger@gmail.com>
583d7d066b30d8d38df7d7c2e9e78045?d=identicon&s=25 Anthony Ettinger (Guest)
on 2008-07-13 07:27
(Received via mailing list)
I wonder if its because my ISP only allows one instance of mongrel per
application/proxy

I am not able to use mongrel_cluster.

On Sat, Jul 12, 2008 at 8:20 PM, sathishkumar <sathishjob@gmail.com>
wrote:
> mongrel gets crashed becasue of the error this is the exact error :
>>
>> >>
>> > Kris
>> 408-656-2473
>> http://anthony.ettinger.name
>>
>>
>
>
> >
>



--
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name
Eaa0d4b131fc4058422ba68f8902969d?d=identicon&s=25 Steve Austen (steveausten555)
on 2010-11-26 20:58
hi its seems like you have done a hard work on it. I have got lots of
information from your post. Really appreciate your work.!! It was
describe very nicely keep us doing good work..
<a href="http://www.dealsourcedirect.com/ion-tape2pc.html/"...
Cassette to CD</a>
<a href="http://www.dealsourcedirect.com/toy-story-lamp.htm... story
lamp</a>
This topic is locked and can not be replied to.