Django: WSGI delays
I've deployed a django-application, which basically works fine. The only problem I have is that there are sometimes requests hanging, and I can't find the reason for this. "Hanging" means, e.g. if I click on a link in the admin backend, the browser loads (and the apache access log does not even show a GET-request at this time), but gets no answer. Only if I request again, it gets answered.
I tried out many different WSGI-Configurations, including Daemon/embedded mode changes, changes in the amount of processes and threads etc. I just don't have an idea where to search further. Here my current apache configuation:
<VirtualHost myserver.com:80> ServerName myserver.com Alias /media/ /opt/myserver/static_media/admin/ Alias /favicon.ico /opt/myserver/static_media/img/favicon.ico WSGIScriptAlias / /opt/myserver/myproject.wsgi WSGIDaemonProcess myserver.com user=www-data group=www-data processes=2 threads=15 ErrorLog /var/log/apache2/myserver-error.log CustomLog /var/log/apache2/myserver.log common </VirtualHost>
And my wsgi-file:
import os, sys sys.path.append('/usr/local/django') sys.path.append('/opt/myproject') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
Please check the Apache error logs. There might be a python error/stacktrace in there.
I also think you miss the assignment of the daemon to a hosted folder:
<Directory /opt/myserver/> WSGIProcessGroup server.com Order deny,allow Allow from all </Directory>