A quickie showing how a configuration of supervisord's memmon in the context of a full supervisord configuration file.
[supervisord] logfile = /tmp/supervisord.log #loglevel = debug # Try keeping your-app running at all times. [program:your-app] command=/your/app autostart=true autorestart=true startsecs=5 startretries=3 stopsignal=TERM stopwaitsecs=10 log_stdout=true log_stderr=true logfile=/tmp/your-app.log logfile_maxbytes=10MB logfile_backups=10 # Restart your-app when it's using more than 50MB of memory [eventlistener:memmon] command=memmon -p your-app=50MB # Check every 60 seconds events=TICK_60 # The eventlistener plugin depends on [rpcinterface:supervisor] and a server # [inet_http_server] or [unix_http_server] to communicate to the supervisor. [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisord] logfile = /tmp/supervisord.log #loglevel = debug [inet_http_server] port = 9001