1. Zachary Voase
  2. django-in-a-box


django-in-a-box / docs / tools / supervisor.md


Supervisor is a tool for starting, stopping and managing processes. It is used in Django-in-a-Box to manage the lighttpd and FastCGI processes. You can also run daemons like task queues and various workers.

In the initial DiaB setup, Supervisor is configured with a program called memmon which will kill any runaway processes (by default, those with a memory consumption greater than 300MB). For more information on configuring the memmon command, consult the documentation at the Superlance PyPI page.

The Supervisor Manual provides far better documentation than I can hope to provide here. I can, however, offer some good recipes for Django-in-a-Box:

# Start Supervisor
$ supervisord

# Check Supervisor’s status
$ supervisorctl status

# Restart lighttpd
$ supervisorctl restart lighttpd

# Restart all FastCGI workers. If you have customised the FastCGI 
# `program_name` setting in `pavement.py`, replace `django` with the custom 
# value.
$ supervisorctl restart django:*

# Shut down Supervisor
$ supervisorctl shutdown

If you ever run supervisorctl and receive an error message ending with:

socket.error: [Errno 61] Connection refused

That usually means that Supervisor is not running. Check the site_dir/log/supervisord.log file for more information if this error persists.