jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

threading problem with mod_wsgi and mod_cgi #198

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Environment:
mod_wsgi 3.2
Apache 2.2.15 (32 bit)
apr 1.3.9
on Solaris 10
SunOS sun 5.10 Generic_142901-08 i86pc i386 i86pc

mod_wsgi is used with threading
other cgi scripts (perl) run via mod_cgi
mod_php is used for php scripts
apache uses mpm_prefork (we have mod_php)

mod_wsgi config:
    WSGIDaemonProcess wsgi user=webservd group=webservd home=/srv/www/empty
display-name=moin-wsgi processes=3 umask=0007
    WSGIRestrictEmbedded On
    WSGIRestrictStdin On
    WSGIRestrictStdout On
    WSGIRestrictSignal On

Problem:
After some requests cgi scripts do not work any longer. When debugging it
looks like Apache does not fork the interpreter. RLimit* does notseem to be
the problem. This happens with "Hello World" cgi scripts.

Resolution/Workaround:
mod_cgid instead of mod_cgi is suggested for MT mpm models.
With mod_cgid everything works.

Original issue reported on code.google.com by florian....@gmail.com on 13 Apr 2010 at 11:06

GoogleCodeExporter commented 8 years ago
ldd /opt/webstack/apache2/2.2/libexec/mod_wsgi.so
        libpython2.6.so.1.0 =>   /opt/webstack/python/lib/libpython2.6.so.1.0
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        librt.so.1 =>    /lib/librt.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libm.so.2 =>     /lib/libm.so.2
        libc.so.1 =>     /lib/libc.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1

/opt/webstack/python/bin/python -V
Python 2.6.5

Original comment by florian....@gmail.com on 13 Apr 2010 at 11:11

GoogleCodeExporter commented 8 years ago
You use WSGIDaemonProcess directive, I presume though you are also using the 
WSGIProcessGroup directive. If not, WSGI 
application will not be getting delegated to the daemon process and because 
WSGIRestrictEmbedded is On, should fail.

Anyway, at the moment I cant think of any reason why there would be a 
problematic interaction betwen mod_cgi and mod_wsgi, 
especially since WSGIRestrictEmbedded is preventing Python even being 
initialised in the Apache server child processes.

I can only suggest not setting WSGIRestrictEmbedded, but cant see that making 
any difference.

You might also try setting Apache LogLevel directive to 'debug' in case it 
outputs anything strange which may give a pointer.

Otherwise, if you come up with any information which might help work it out, 
come over to the mod_wsgi mailing list and raise it 
there for discussion. I am not even sure though where to begin as far as trying 
to debug what the issue may be.

Original comment by Graham.Dumpleton@gmail.com on 14 Apr 2010 at 10:25

GoogleCodeExporter commented 8 years ago
Closing old issue. Never saw any similar reports and know of no problem.

Original comment by Graham.Dumpleton@gmail.com on 12 Nov 2014 at 10:48