0

I'm hosting a Django server on a virtual machine with Apache, and running into some odd timeouts. Specifically, every so often, the server will drop, with logs only displaying Timeout when reading response headers from daemon process 'XXX-0.0.86': /mypath/myproject/wsgi.py.

I'm certain that this is a server-side / configuration issue, as the exact same (quick) GET request will run properly multiple runs before resulting in a timeout in an unpredictable manner. What's more, although I've tried most all the solutions outlined in a similar issue here, (i.e. adding %{GLOBAL}, changing the timeout in httpd.conf, comparing configs, restarting) there's still been no luck. Yet bafflingly, running the project locally or on the VM with python manage.py ... does not throw any errors.

My intern skills are at a loss and I thought I'd turn to the community for help. Attached is the configuration file for the Apache Django daemon. Any tips?

Listen 8075
<Virtualhost *:8075>
    ErrorLog /var/log/httpd/XXX.log

    LoadModule wsgi_module /var/www/cgi-bin/python36_virtenv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so

    Alias /static /var/www/cgi-bin/XXX-0.0.86/XXX/static
    <Directory /var/www/cgi-bin/XXX-0.0.86/XXX/static>
        Require all granted
    </Directory>

    <Directory /var/www/cgi-bin/XXX-0.0.86/XXX/myproject>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess XXX-0.0.86 python-path=/var/www/cgi-bin/XXX-0.0.86/XXX:/var/www/cgi-bin/python36_virtenv/lib/python3.6/site-packages/
    WSGIProcessGroup XXX-0.0.86
    WSGIScriptAlias / /var/www/cgi-bin/XXX-0.0.86/XXX/myproject/wsgi.py
    WSGIPassAuthorization On
    WSGIApplicationGroup %{GLOBAL}

    Alias /stdouts /home/redacted/stdoutbuffer/
    <Directory /home/redacted/stdoutbuffer/>
        Require all granted
        Options +Indexes
    </Directory>

    Alias /artifacts /mnt/results/
    <Directory /mnt/results/>
        Require all granted
        Options +Indexes
    </Directory>

</Virtualhost>
Destaq
  • 655
  • 9
  • 23
  • Do the same parameters work sometimes and fail sometimes? also, it may be an issue with an increased load that causes the view to take longer to respond. especially with low / loaded database – Mohamed ElKalioby May 16 '23 at 10:18
  • @MohamedElKalioby the database shouldn't be an issue, it is quite small. Not sure what you mean with the parameters. In short, for various GET and POST requests alike, they sometimes go through and sometimes not, even if the exact same JSON is used. Perhaps this is a server issue though? There are something like 30 services running on the CentOS instance. Though all of those work brilliantly, not sure why this API would have problems. – Destaq May 16 '23 at 10:41

0 Answers0