Django Webfaction "Timeout while reading response headers from daemon process"

The My Django application on my production server hosted on Webfaction worked fine until I just tried to restart it after clicking on the settings.py file. I ran

apache2/bin/restart 

normally. Then I tried to access my application in my browser, and I had a 504 Gateway timeout. I looked through the mod_wsgi logs and saw this:

 [Thu Nov 03 23:46:53.605625 2016] [wsgi:error] [pid 8027:tid 139641332168448] [client 127.0.0.1:34570] Timeout when reading response headers from daemon process 'myapp' : /home/<me>/webapps/<myapp>/<ProjectName>/<myapp>/wsgi.py 

What does this mean and how to fix it? The only thing I changed in the settings.py file is moving several variable names. I can still successfully interact with the application

 python2.7 manage.py shell 

But I can’t get to it on the Internet and not use the API.

EDIT: Here is my wsgi.py file:

 import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<myapp>.settings") application = get_wsgi_application() 
+10
django mod-wsgi webfaction
source share
3 answers

Python C extension modules, such as numpy, are known to cause timeouts when used in mod_wsgi. There is a clear explanation of the problem (directly from the author of mod_wsgi), available at https://serverfault.com/a/514251/109598

If it looks like this might be causing your problem, then the solution is probably simple - add the following to your httpd.conf:

 WSGIApplicationGroup %{GLOBAL} 

Be sure to restart your Apache instance after making the changes.

+16
source share

In my case, because of the .pyc files, I was getting a timeout error. I deleted the pyc files from the wsgi directory, restarted the server and did ...

0
source share

increase apache httpd timeout worked for me

-one
source share

All Articles