I am running Django 1.4 sites on Ubuntu 12.04 with supervisor 3.0a8-1.1 and have run into a strange problem with gunicorn 0.17.2 and gevent 0.13.8.
Supervisor's memory usage keeps growing until the server is not responsive.
There are 5 sites with the following supervisor configs:
command=/app/virtualenv/bin/newrelic-admin run-program /app/virtualenv/bin/python /app/manage.py run_gunicorn -c gunicorn_conf.py -k gevent
directory=/app
autostart=true
autorestart=true
stopsignal=KILL
killasgroup=true
environment=NEW_RELIC_CONFIG_FILE='/app/newrelic.ini'
and the following gunicorn configs:
workers = 4
bind = '0.0.0.0:(Site Port Number)'
These are all being reverse proxied to via NGINX.
I am running these on a large EC2 instance which has 2 cores and 7.3GB of RAM which should be way more than I need.
Has anyone else run into this problem?
If memory is clearing correctly when you just run the projects without supervisord, that's baffling.
Supervisord is just a daemon manager. It doesn't do anything but launch and manage a process, which, in this case, is just manage.py.
The only thing I could think is that autorestart is turned on, which has been known to cause a memory leak, if supervisor is constantly restarting the process because it detects a change and errors don't get cleared out. This was actually fixed in supervisor 3.0b1. Maybe update your supervisor?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With