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()

Any ideas?

Answers


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>

Need Your Help

Get the exact battery level on android

java android battery batterylevel

So I currently have the following commonly used method of acquiring the current battery level implemented in my android app.

how to parse HTML tags in RSS feed in Python

python html parsing rss

I have a small utility that is to be used to produce a readout of an RSS feed in plain text. Here is representative code: