[Django]-Resource temporarily unavailable: mod_wsgi (pid=28433): Unable to connect to WSGI daemon process

0👍

After finding no answers, I solved it restarting Apache.

0👍

From: http://engineering.hackerearth.com/2013/11/21/scaling-python-django-application-apache-mod_wsgi/

Tweaking mpm-worker configuration

<IfModule mpm_worker_module>
    StartServers         2
    MinSpareThreads      10
    MaxSpareThreads      25
    ThreadLimit          25
    ThreadsPerChild      25
    MaxClients           75
    MaxRequestsPerChild   0
</IfModule>

This configuration enforces following rules:

Initial number of server processes started is two.
Maximum number of clients is restricted to 75.
Each process has 25 threads.
Maximum number of processes that could be created is 75/25 = 3.
Our process size is ~220 MB (very very fat, I know!), so that means we only need ~660 MB in the worst case.

0👍

We found that adjusting mod_wsgi listen-backlog and increasing net.core.somaxconn (at least on Ubuntu) seems to eliminate the listener backlog limit was exceeded issues. Of course, this highly depends on level of traffic and users.

Leave a comment