Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Apache connection times out with New Relic active #78

Closed
mattdeboard opened this issue Mar 30, 2012 · 1 comment
Closed

Apache connection times out with New Relic active #78

mattdeboard opened this issue Mar 30, 2012 · 1 comment

Comments

@mattdeboard
Copy link

Our web servers have Nginx reverse proxying Apache serving our Django app. We are also running New Relic's Python agent with the required changes to our WSGI module:

import os, sys

import newrelic.agent
newrelic.agent.initialize('/path/to/project/newrelic.ini')

PROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),"../")
PROJECT_DIR_PARENT = os.path.join(PROJECT_DIR, "../")
if PROJECT_DIR not in sys.path:
    sys.path.append(PROJECT_DIR)
if PROJECT_DIR_PARENT not in sys.path:
    sys.path.append(PROJECT_DIR_PARENT)

os.environ['CELERY_LOADER'] = 'django'
os.environ['DJANGO_SETTINGS_MODULE'] = 'projectname.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
application = newrelic.agent.wsgi_application()(application)

We've tried upgrading our current old-style Sentry installation to the Raven/Sentry paradigm, but Nginx reports a 504 (timeout) error when trying to proxy to Apache. However, if I comment out the New Relic-related lines in my WSGI module, it connects beautifully.

@mattdeboard
Copy link
Author

I'll tentatively close this issue pending testing of a possible solution from New Relic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant