Thank you very much for a quick reply:

I cannot copy the logs/configs from my firm but I will try my best to 
re-create(manual copy paste) it here

*Apache Configuration*:

LoadModule log_config_module <...../mod_log_config.so>
LoadModule wsgi_module <...../mod_wsgi.so>
LoadModule authz_host_module <..../mod_authz_host.so>

Listen 8080

PidFile <...path to pid file>

LogLevel Info
ErroLog /local/scratch/apache.err
TransferLog /local/scratch/apache.out

WSGIApplicationGroup %{GLOBAL}

WSGIRestrictEmbedded On

WSGISocketPrefix /local/scratch/run/wsgi

<VirtualHost *:8080>

    ServerName xyz.com

    WSGIDaemonProcess myapp processes=5 threads=5 display-name=%{GROUP} 
deadlock-timeout=60
    WSGIApplicationGroup %{GLOBAL}
    WSGIProcessGroup myapp
    WSGIScriptAlias / /local/scratch/....../bin/webapp-1.0.wsgi

    <Directory /local/scratch/....../bin>
        Order allow, deny
        Allow from all
    </Directory>

</VirtualHost>


*Logs:*

[info] mod_wsgi (pid=5038): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5038): Initializing Python.
[notice] Apache/2.2.24 (Unix) mod_wsgi/4.3.2 Python/2.7.1 configured -- 
resuming normal operations
[info] Server built: Aug 2 2013 13.51.41
[info] mod_wsgi (pid=5040): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5041): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5040): Initializing Python.
[info] mod_wsgi (pid=5039): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5039): Initializing Python.
[info] mod_wsgi (pid=5042): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5041): Initializing Python.
[info] mod_wsgi (pid=5042): Initializing Python.
[info] mod_wsgi (pid=5038): Attaching interpreter ''.
[info] mod_wsgi (pid=5042): Attaching interpreter ''.
[info] mod_wsgi (pid=5041): Attaching interpreter ''.
[info] mod_wsgi (pid=5040): Attaching interpreter ''.
[info] mod_wsgi (pid=5039): Attaching interpreter ''.

[info] [client 10.79.29.2] mod_wsgi (pid=5038, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'

[info] [client 10.79.29.2] mod_wsgi (pid=5042, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'

[info] [client 10.79.29.2] mod_wsgi (pid=5040, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'

[info] [client 10.79.29.2] mod_wsgi (pid=5039, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'

[info] [client 10.79.29.2] mod_wsgi (pid=5041, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] server seems busy, (you many need to increase StartServers, or 
Min/MaxSpareServers), spawning 8 children, there are 0 idle, and 12 total 
children

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] server seems busy, (you many need to increase StartServers, or 
Min/MaxSpareServers), spawning 16 children, there are 0 idle, and 20 total 
children

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] server seems busy, (you many need to increase StartServers, or 
Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 36 total 
children

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] server seems busy, (you many need to increase StartServers, or 
Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 68 total 
children

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] mod_wsgi (pid=5038): Daemon process deadlock timer expired, stopping 
process 'myapp'
[info] mod_wsgi (pid=5038): Shutdown requested 'myapp'
[info] mod_wsgi (pid=5041): Daemon process deadlock timer expired, stopping 
process 'myapp'
[info] mod_wsgi (pid=5041): Shutdown requested 'myapp'
[info] mod_wsgi (pid=5042): Daemon process deadlock timer expired, stopping 
process 'myapp'
[info] mod_wsgi (pid=5042): Shutdown requested 'myapp'
[info] mod_wsgi (pid=5038): Aborting process 'myapp'
[info] mod_wsgi (pid=5038): Exiting process 'myapp'

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] mod_wsgi (pid=5038): Process 'myapp' had died, deregister and 
restart it
[info] mod_wsgi (pid=5038): Process 'myapp' has been deregistered and will 
no longer be monitored
[info] mod_wsgi (pid=5405): Starting process 'myapp' with threads=5
[info] mod_wsgi (pid=5405): Initializing Python.
[info] mod_wsgi (pid=5405): Attaching interpreter ''.

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................

[info] mod_wsgi (pid=5041): Aborting process 'myapp'
[info] mod_wsgi (pid=5041): Exiting process 'myapp'


[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................


[info] [client 10.79.29.2] mod_wsgi (pid=5405, process='myapp', 
application=''): Loading WSGI script 
'/local/scratch/....../bin/webapp-1.0.wsgi'


[info] mod_wsgi (pid=5042): Aborting process 'myapp'
[info] mod_wsgi (pid=5042): Exiting process 'myapp'

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................


[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

[error] [client 10.79.29.2] Truncated or oversized response headers 
received from daemon process 'myapp': 
/local/scratch/....../bin/webapp-1.0.wsgi

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................


[info] mod_wsgi (pid=5041): Process 'myapp' had died, deregister and 
restart it
[info] mod_wsgi (pid=5041): Process 'myapp' has been deregistered and will 
no longer be monitored
[info] mod_wsgi (pid=5042): Process 'myapp' had died, deregister and 
restart it
[info] mod_wsgi (pid=5042): Process 'myapp' has been deregistered and will 
no longer be monitored

................
................
[error] <All the print statements from python app is getting logged here as 
an error>
................
................


*Please let me know if there is any more info required*


On Tuesday, January 22, 2019 at 8:11:18 PM UTC+5:30, Graham Dumpleton wrote:
>
> Can you show the actual parts of the Apache configuration for mod_wsgi and 
> your WSGI application. The clues you have given aren't really enough. Need 
> to see the actual config to know if you have it correct. The actual log 
> messages also are important as they confirm in what context the WSGI 
> application runs. Ensure though you have LogLevel set to info to get most 
> useful information.
>
> On 22 Jan 2019, at 5:39 pm, Shakim Mohammed <[email protected] 
> <javascript:>> wrote:
>
> Hello,
>
> I have a Flask + Sqlalchemy application(connecting to a Sybase database) 
> that I am trying to run in Apache + mod_wsgi setup
>
> Few pointers on my wsgi setup:
>
>    - Using WSGIDaemonProcess <nameOfApp> processes=x threads=y
>    - Using WSGIApplicationGroup %{GLOBAL}
>
> No matter what combination of values of *x* and *y* I use, after 
> processing some request, my apache/mod_wsgi hangs up for sometime showing 
> logs like :
>
>    - Daemon process deadlock timer expired, stopping process <>
>    - Shutdown process <nameOfApp>
>    - Aborting process <nameOfApp>
>    - Exiting process <nameOfApp>
>
> I believe it hangs for 300 seconds(which is default deadlock-timeout)
> If I set deadlock-timeout = 60, apache/mod_wsgi recovers in 60sec
>
> Few other logs that I see are :
>
>    - Truncated or oversized response headers received from daemon process 
>    <nameOfApp>
>    - server seems busy, (you may need to increase StartServers, or 
>    Min/MaxServers, spawning 16 children, there are three idle 
>    
> What could be the reason of this deadlock and other logs shown above?
>
> Could this be because of a rogue C extension as pointed out by Graham at 
> various places?
>
> There are bunch of third party modules that I am using which has C 
> extension like -> http://python-sybase.sourceforge.net/download.html
>
> Is there anyway to fix this or make it more stable(not going into deadlock 
> too frequently and giving 500 to clients)?
>
> FYI, I am using prefork instead of worker at this moment. I am not loading 
> unnecessary modules like mod_php.
> The only modules that I am loading in my apache conf are 
> "mod_authz_host.so", "mod_log_config.so" and "mod_wsgi.so"
> I believe the issue I am trying to highlight is totally independent of 
> whether it is a prefork or worker setup
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] <javascript:>
> .
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to