Memmon republicado de github
Command-Line Syntax
$ memmon [-c] [-p processname=byte_size] [-g groupname=byte_size] \
[-a byte_size] [-s sendmail] [-m email_address] \
[-u email_uptime_limit] [-n memmon_name]
Note
Specifying this option doesn't cause memmon to send mail by itself: see the -m / --email option.
Configuring :command:`memmon` Into the Supervisor Config
An [eventlistener:x] section must be placed in :file:`supervisord.conf` in order for :command:`memmon` to do its work. See the "Events" chapter in the Supervisor manual for more information about event listeners.
The following examples assume that :command:`memmon` is on your system :envvar:`PATH`.
Example Configuration 1
This configuration causes :command:`memmon` to restart any process which is a child of :command:`supervisord` consuming more than 200MB of RSS, and will send mail to bob@example.com when it restarts a process using the default :command:`sendmail` command.
[eventlistener:memmon]
command=memmon -a 200MB -m bob@example.com
events=TICK_60
Example Configuration 2
This configuration causes :command:`memmon` to restart any process with the supervisor program name foo consuming more than 200MB of RSS, and will send mail to bob@example.com when it restarts a process using the default sendmail command.
[eventlistener:memmon]
command=memmon -p foo=200MB -m bob@example.com
events=TICK_60
Example Configuration 3
This configuration causes :command:`memmon` to restart any process in the process group "bar" consuming more than 200MB of RSS, and will send mail to bob@example.com when it restarts a process using the default :command:`sendmail` command.
[eventlistener:memmon]
command=memmon -g bar=200MB -m bob@example.com
events=TICK_60
Example Configuration 4
This configuration causes :command:`memmon` to restart any process meeting the same requirements as in Example Configuration 2 with one difference:
The email will only be sent if the process' uptime is less or equal than 2 days (172800 seconds)
[eventlistener:memmon]
command=memmon -p foo=200MB -m bob@example.com -u 2d
events=TICK_60
Comentários