What are the WSGIDaemonProcess directive options you are using?
That message above implies that some code in the application, normally
a C extension module, acquired the Python GIL and then did a long
operation which blocks, without releasing the GIL.
The default deadlock timeout is 5 minutes however, so that the daemon
process wasn't processing other requests should have been noticeable.
Have you overridden the default deadlock timeout?
Graham
> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>
On 6 August 2010 13:05, colorpyen <colo...@gmail.com> wrote:
> Hi Graham,
>
> Thanks for your quick response. My DaemonProcess directive is listed
> below. I didn't try to override the deadlock timeout as it didn't
> cause any problem in wsgi3.0c. I tried to downgrade wsgi to 2.8 and
> now it works okay. But I am still curious about why the deadlock
> problem may cause. Any C extension you can think of as it may
> introduce the problem. I use PIL 1.7 and Lxml.
The lxml package has had known problems working in Python sub
interpreters in the past.
Try with mod_wsgi 3.3, but add:
WSGIApplicationGroup %{GLOBAL}
to force use of main Python interpreter.
If you are hosting multiple WSGI applications, you will want to
restrict that directive to context of that specific application, or
ensure that each application is run in its own daemon process group to
ensure separation in case framework being used cant handle multiple
instances running in same interpreter.
Forcing use of main interpreter will avoid potential for issues where
packages not compatible with sub interpreters.
> Is overriding deadlock timeout introducing any performance degradation
> if set?
>
> WSGIDaemonProcess koistore processes=1
Don't set 'processes=1', let it default to '1'. Use of the 'processes'
option, no matter the value, flags to WSGI application that it is
running across multiple processes. Triggering that prevents things
which expect to run in a single process, and check that value, from
working.
> threads=5 display-name=%
> {GROUP} \
> home=/var/www/koistore \
> python-path=/usr/local/pythonenv/DJANGO/lib/
> python2.6/site-packages \
> python-eggs=/tmp/python-eggs
It is generally a bad idea to put Python eggs cache in /tmp, at least
on systems where server used by different users.
Graham
> # process group that serves this WSGI application in the virtual
> host
> WSGIProcessGroup koistore
>
> Thanks a lot
>
> -peter
>
> On Aug 6, 7:45 am, Graham Dumpleton <graham.dumple...@gmail.com>
> wrote:
Not sure I understand the question.
Multiple threads in daemon mode work fine if using either prefork or
worker MPM in Apache.
The only requirement is that when using prefork MPM, the underlying
APR libraries must have thread support compiled into them.
Also, your code should also be thread safe.
Obviously how many threads to use is a topic involving much hand
waving, as well as lots of smoke and mirrors as it depends on so many
factors.
Anyway, as I said, not sure what exactly you are wanting to know.
Graham
On Thursday, August 5, 2010 11:12:51 PM UTC-4, Graham Dumpleton wrote:Try with mod_wsgi 3.3, but add:
WSGIApplicationGroup %{GLOBAL}
to force use of main Python interpreter.
Graham, thanks so much for this advice. This solved a persistent problem for me.Are there downsides to doing this -- should I be motivated to find & solve the root cause? Or is the WSGIApplicationGroup approach something I can use in the long term and not worry about?
Is there a way to identify the offending module that's causing the GIL problem?
Thank you
--
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 modwsgi+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi?hl=en.For more options, visit https://groups.google.com/groups/opt_out.