From 4349652865fa17e392a5af02200ff585114d6d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Thu, 29 Mar 2012 00:18:43 +0200 Subject: configured gunicorn/redis make gunicorn port configurable. start redis only in development mode. --- conf/prod_settings.tpl | 2 ++ sublab_project/settings.py | 2 ++ sublab_project/supervisord.conf | 6 ++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/prod_settings.tpl b/conf/prod_settings.tpl index 4a680ba..93df711 100644 --- a/conf/prod_settings.tpl +++ b/conf/prod_settings.tpl @@ -2,6 +2,8 @@ import os from settings import SITE_ROOT +# GUNICORN_PORT = '8000' + AUTH_LDAP_SERVER_URI = 'ldap://oberon.local.sublab.org' AUTH_LDAP_BIND_PASSWORD = '' diff --git a/sublab_project/settings.py b/sublab_project/settings.py index b28a007..a1849c6 100644 --- a/sublab_project/settings.py +++ b/sublab_project/settings.py @@ -236,6 +236,8 @@ REDIS_SESSION_CONFIG = { 'COMPRESS_LIB': '', } +GUNICORN_PORT = '8000' + try: from local_settings import * except ImportError: diff --git a/sublab_project/supervisord.conf b/sublab_project/supervisord.conf index c940dfd..f212d36 100644 --- a/sublab_project/supervisord.conf +++ b/sublab_project/supervisord.conf @@ -1,5 +1,5 @@ [program:gunicorn] -command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py run_gunicorn +command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py run_gunicorn --workers=2 --max-requests=1000 --bind=127.0.0.1:{{ settings.GUNICORN_PORT }} {% if settings.DEBUG %} exclude=true {% endif %} @@ -25,9 +25,7 @@ stopwaitsecs = 600 [program:celerycam] command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py celerycam -[program:redis] {% if settings.DEBUG %} -command=redis-server -{% else %} +[program:redis] command=redis-server {% endif %} -- cgit v1.2.1