Just in case I can't get to it tonight, I'll give you the basic idea..

memmon relies on the output of ps to determine the Resident Set Size
(RSS) memory usage.  My idea was to add a command line switch that
would tell it to check the memory of the child processes also using ps
(specifically ps -orss= --ppid <parentpid>).  The next part depends on
what you desire..

A couple of choices off the top of my head:

1. Determine the aggregate RSS usage of the child processes, restart
if defined limit is reached.
2. If any one of the child processes reaches the defined limit,
restart the parent.

Sometimes it may not be desirable to restart the parent process
completely.  You could easily add in code to send a specific signal to
the parent instead of restarting via the supervisord xml-rpc
interface.

The way the memmon code is written, all of the above is attainable
with minimal code.

On Tue, May 18, 2010 at 12:23 PM, George Kollias
<[email protected]> wrote:
> Of course i am interesting :)
> I would appreciate it a lot.
>
>
> Thank you,
> G. Kollias
>
> On Tue, May 18, 2010 at 7:19 PM, Benjamin Smith
> <[email protected]> wrote:
>>
>> It won't work out of the box to my knowledge.  I have an idea for a
>> patch to memmon to make it possible.  If interested, I'll throw it
>> together this evening.
>>
>> On Tue, May 18, 2010 at 12:07 PM, kevin beckford <[email protected]> wrote:
>> > On Tue, May 18, 2010 at 7:44 AM, George Kollias
>> > <[email protected]> wrote:
>> >> Hi again,
>> >> I tested 'memmon' and i have a little problem. 'Supervisor' monitors a
>> >> master process which  in turn has two sub-processes (not threads), so
>> >> 'memmon' checks only the master process's memory and not
>> >> sub-processes'. Can
>> >> i have 'memmon' checks the sub-processes memory too?
>> >
>> > Actually that's a good question, I do not know the answer however.
>> > _______________________________________________
>> > Supervisor-users mailing list
>> > [email protected]
>> > http://lists.supervisord.org/mailman/listinfo/supervisor-users
>> >
>>
>>
>>
>> --
>> Benjamin Smith
>> http://just-another.net
>> http://twitter.com/benjaminws
>> http://www.linkedin.com/in/benjaminwarfield
>
>



-- 
Benjamin Smith
http://just-another.net
http://twitter.com/benjaminws
http://www.linkedin.com/in/benjaminwarfield
_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to