Hoping that this final revert of settings will do the trick on the corrupt transactions.

This commit is contained in:
Samuel Clay 2015-12-18 15:34:05 -08:00
parent d7d0230fd4
commit 5c7d39d032
3 changed files with 38 additions and 21 deletions

16
fabfile.py vendored
View file

@ -320,6 +320,7 @@ def setup_installs():
'libdbd-pg-perl', 'libdbd-pg-perl',
'libssl-dev', 'libssl-dev',
'libffi-dev', 'libffi-dev',
'libevent-dev',
'make', 'make',
'pgbouncer', 'pgbouncer',
'python-setuptools', 'python-setuptools',
@ -466,6 +467,21 @@ def setup_hosts():
put(os.path.join(env.SECRETS_PATH, 'configs/hosts'), '/etc/hosts', use_sudo=True) put(os.path.join(env.SECRETS_PATH, 'configs/hosts'), '/etc/hosts', use_sudo=True)
sudo('echo "\n\n127.0.0.1 `hostname`" | sudo tee -a /etc/hosts') sudo('echo "\n\n127.0.0.1 `hostname`" | sudo tee -a /etc/hosts')
def setup_pgbouncer():
sudo('apt-get remove -y pgbouncer')
sudo('apt-get install -y libevent-dev')
PGBOUNCER_VERSION = '1.7'
with cd(env.VENDOR_PATH), settings(warn_only=True):
run('wget https://pgbouncer.github.io/downloads/files/%s/pgbouncer-%s.tar.gz' % (PGBOUNCER_VERSION, PGBOUNCER_VERSION))
run('tar -xzf pgbouncer-%s.tar.gz' % PGBOUNCER_VERSION)
run('rm pgbouncer-%s.tar.gz' % PGBOUNCER_VERSION)
with cd('pgbouncer-%s' % PGBOUNCER_VERSION):
run('./configure --prefix=/usr/local --with-libevent=libevent-prefix')
run('make')
sudo('make install')
sudo('ln -s /usr/local/bin/pgbouncer /usr/sbin/pgbouncer')
config_pgbouncer()
def config_pgbouncer(): def config_pgbouncer():
put('config/pgbouncer.conf', 'pgbouncer.conf') put('config/pgbouncer.conf', 'pgbouncer.conf')
sudo('mv pgbouncer.conf /etc/pgbouncer/pgbouncer.ini') sudo('mv pgbouncer.conf /etc/pgbouncer/pgbouncer.ini')

View file

@ -170,10 +170,10 @@ LOGGING = {
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'include_html': True, 'include_html': True,
}, },
'sentry': { # 'sentry': {
'level': 'ERROR', # 'level': 'ERROR',
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler' # 'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler'
}, # },
}, },
'loggers': { 'loggers': {
'django.request': { 'django.request': {
@ -200,16 +200,16 @@ LOGGING = {
'level': 'INFO', 'level': 'INFO',
'propagate': True, 'propagate': True,
}, },
'raven': { # 'raven': {
'level': 'DEBUG', # 'level': 'DEBUG',
'handlers': ['console'], # 'handlers': ['console'],
'propagate': False, # 'propagate': False,
}, # },
'sentry.errors': { # 'sentry.errors': {
'level': 'DEBUG', # 'level': 'DEBUG',
'handlers': ['console'], # 'handlers': ['console'],
'propagate': False, # 'propagate': False,
}, # },
}, },
'filters': { 'filters': {
'require_debug_false': { 'require_debug_false': {
@ -282,7 +282,7 @@ INSTALLED_APPS = (
'django.contrib.admin', 'django.contrib.admin',
'django_extensions', 'django_extensions',
'djcelery', 'djcelery',
'kombu.transport.django', # 'kombu.transport.django',
'vendor.paypal.standard.ipn', 'vendor.paypal.standard.ipn',
'apps.rss_feeds', 'apps.rss_feeds',
'apps.reader', 'apps.reader',
@ -321,9 +321,9 @@ ZEBRA_ENABLE_APP = True
import djcelery import djcelery
djcelery.setup_loader() djcelery.setup_loader()
from celery import Celery # from celery import Celery
celeryapp = Celery() # celeryapp = Celery()
celeryapp.config_from_object('django.conf:settings') # celeryapp.config_from_object('django.conf:settings')
CELERY_ROUTES = { CELERY_ROUTES = {
"work-queue": { "work-queue": {
"queue": "work_queue", "queue": "work_queue",
@ -524,6 +524,7 @@ REDIS_SESSIONS = {
} }
CELERY_REDIS_DB_NUM = 4 CELERY_REDIS_DB_NUM = 4
CELERY_REDIS_DB = CELERY_REDIS_DB_NUM
SESSION_REDIS_DB = 5 SESSION_REDIS_DB = 5
# ================= # =================
@ -574,12 +575,12 @@ from local_settings import *
if not DEBUG: if not DEBUG:
INSTALLED_APPS += ( INSTALLED_APPS += (
'gunicorn', 'gunicorn',
'raven.contrib.django.raven_compat', 'raven.contrib.django',
'django_ses', 'django_ses',
) )
# RAVEN_CLIENT = raven.Client(dsn=SENTRY_DSN, release=raven.fetch_git_sha(os.path.dirname(__file__))) # RAVEN_CLIENT = raven.Client(dsn=SENTRY_DSN, release=raven.fetch_git_sha(os.path.dirname(__file__)))
RAVEN_CLIENT = raven.Client(dsn=SENTRY_DSN) RAVEN_CLIENT = raven.Client(SENTRY_DSN)
COMPRESS = not DEBUG COMPRESS = not DEBUG

View file

@ -85,7 +85,7 @@
<img src="/media/img/logo_512.png" class="logo"> <img src="/media/img/logo_512.png" class="logo">
<h1>NewsBlur is in <span class="error404">maintenance mode</span></h1> <h1>NewsBlur is in <span class="error404">maintenance mode</span></h1>
<div class="description"> <div class="description">
<p>Power cycling the redis DBs to fix the lag that's hit feed fetching all this week. This should take no longer than five minutes.</p> <p>Power cycling the PostgreSQL DBs to fix the lag that's hit feed fetching all this week. This should take no longer than two minutes.</p>
<p>To pass the time, <a href="http://mlkshk.com/popular">check out what's popular on MLKSHK</a>.</p> <p>To pass the time, <a href="http://mlkshk.com/popular">check out what's popular on MLKSHK</a>.</p>
</div> </div>
</div> </div>