I'm observing some interesting behavior when using urlopen() in a
Django app in conjunction with mod_wsgi.

Basically, from what I understand, urllib2 will leave a socket
connection open even after the close() method is called on it. There
are various theories as to how/why it does this that I have read.

Be that as it may, what I'm noticing is that when I make a request
that's using urllib2's urlopen() somewhere on the backend, the thread
from that request is staying alive. So, e.g. if I were to make 10
requests successively, each calling urlopen(), I'd wind up with 10
threads hanging out, not going anywhere, in my process list.
Eventually, I seem to hit some sort of ceiling and I start getting
error responses back.

This could very well be urllib2's problem, or more likely there could
be a configuration issue on my part that is causing this. It does seem
a bit unlikely that this would not have come up for anyone else.

FWIW, I am using Apache in worker MPM mode, and the behavior occurs
whether or not I use mod_wsgi in daemon mode.

Apologies in advance if there is anything obvious I am overlooking.
I'm more of an application developer and a lot of this stuff is fairly
new for me.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to