1. Chris Hasenpflug
  2. django-project-template

Commits

Chris Hasenpflug  committed 5c4d2bb

Use a proper Gunicorn configuration file and switch to gevent.

  • Participants
  • Parent commits e6e4c80
  • Branches master

Comments (0)

Files changed (4)

File Procfile

View file
  • Ignore whitespace
-web: newrelic-admin run-program python ./manage.py run_gunicorn -b 0.0.0.0:$PORT -w 4
+web: newrelic-admin run-program python ./manage.py run_gunicorn -c gunicorn_conf.py

File gunicorn_conf.py

View file
  • Ignore whitespace
+"""gunicorn WSGI server configuration."""
+
+from multiprocessing import cpu_count
+from os import environ
+
+
+bind = '0.0.0.0:' + environ.get('PORT', '8000')
+max_requests = 1000
+worker_class = 'gevent'
+workers = cpu_count() * 2 + 1

File requirements/base.txt

View file
  • Ignore whitespace
 
 Django >= 1.4, < 1.5
 pytz
--e git+git://github.com/benoitc/gunicorn.git#egg=gunicorn
 boto
 django-storages
 

File requirements/production.txt

View file
  • Ignore whitespace
 psycopg2
 newrelic
 raven>=1.7.3
+gevent
+gunicorn