killing ruby processes that take up too much memory.

8 views
Skip to first unread message

Mathijs

unread,
Nov 17, 2008, 5:39:51 AM11/17/08
to Phusion Passenger Discussions
Hi all,

I have a few production apps running on passenger. Some of them use
some internal library I've written, and I'm affraid it has some memory
(leaking) issues. after a random amount of time it starts misbehaving
and taking up memory until the server is unreachable because it's too
busy swapping.
I would like to have the offending process killed when its memory uses
goes above a certain level. I couldn't find a config option for this
in passenger.
Should I use external monitoring applications (like mon or god) for
this? or is there a better way?

and a bit offtopic - I would like to find out what happens in the
process that misbehaves.
Is there a good memory-monitoring application that tracks which
objects are in memory, for how long, and why they aren't GC'd ?

Thanks,
Mathijs

Hongli Lai

unread,
Nov 17, 2008, 5:45:33 AM11/17/08
to phusion-...@googlegroups.com
Mathijs wrote:
> Hi all,
>
> I have a few production apps running on passenger. Some of them use
> some internal library I've written, and I'm affraid it has some memory
> (leaking) issues. after a random amount of time it starts misbehaving
> and taking up memory until the server is unreachable because it's too
> busy swapping.
> I would like to have the offending process killed when its memory uses
> goes above a certain level. I couldn't find a config option for this
> in passenger.
> Should I use external monitoring applications (like mon or god) for
> this? or is there a better way?

Passenger does not provide such a feature builtin. The development
version in git had it, but it was removed because of stability issues.
It might be put back later in an improved form.

In the mean time, you'll have to find third party tools for achieving this.


> and a bit offtopic - I would like to find out what happens in the
> process that misbehaves.
> Is there a good memory-monitoring application that tracks which
> objects are in memory, for how long, and why they aren't GC'd ?

You might want to look at Bleakhouse, although it's not a monitoring
application.

As for "why they're not GC'd", the answer is always "because there's
still a reference to it from the root set".

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Reply all
Reply to author
Forward
0 new messages