Gunicorn changes on server.

This commit is contained in:
Samuel Clay 2010-10-06 19:12:38 -04:00
parent 29225a74e3
commit 0e0940317f
3 changed files with 4 additions and 15 deletions

View file

@ -1,12 +0,0 @@
import os
def numCPUs():
if not hasattr(os, "sysconf"):
raise RuntimeError("No sysconf detected.")
return os.sysconf("SC_NPROCESSORS_ONLN")
bind = "127.0.0.1:8000"
pidfile = "/tmp/gunicorn_newsblur.pid"
logfile = "/home/conesus/newsblur/logs/production.log"
loglevel = "debug"
workers = numCPUs() #* 2 + 1

View file

@ -72,7 +72,7 @@ MIDDLEWARE_CLASSES = (
'django.middleware.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.cache.CacheMiddleware',
# 'django.middleware.cache.CacheMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'apps.profile.middleware.LastSeenMiddleware',
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
@ -195,6 +195,7 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.admin',
'django_extensions',
'gunicorn',
'djcelery',
'compress',
'apps.rss_feeds',
@ -267,6 +268,7 @@ CELERY_DISABLE_RATE_LIMITS = True
# = Configurations =
# ==================
from gunicorn_conf import *
from local_settings import *
COMPRESS = not DEBUG

View file

@ -1,5 +1,4 @@
#!/bin/sh
#ps aux | grep 8080 | egrep -v 'grep' | awk '{print $2}' | xargs kill; ./manage.py runfcgi method=threaded host=127.0.0.1 port=8080
sudo /etc/init.d/gunicorn restart
sudo supervisorctl restart gunicorn
echo '----\n'
tail -f /home/conesus/newsblur/logs/newsblur.log