Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Graham Dumpleton

On Oct 21, 10:51 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Ulf Kronman schrieb:> I'm using Django trunk and I have set the 
> MaxRequestsPerChild 1
> > directive in httpd.conf. I'm running on Windows XP (sp3?).
>
> Here a guess:
>
> Apache creates several threads (or worker processes) and after one
> request the thread/process gets killed. But the other are still alive and
> have the old code loaded.

On Windows there is only one Apache worker process containing many
threads. Thus, the problem of a request going to another process with
older code loaded shouldn't be an issue. Even on UNIX that shouldn't
be an issue with MaxRequestsPerChild set to 1 unless specific effort
was put into to preload Django code at process startup using
PythonImport directive.

I did have a think about OP issue, but off the top of my head I
couldn't work out why they would see the behaviour they were seeing
unless Apache is a bit loose with its counting, or it is an oddity of
how a restart of Apache worker process on Windows works.

> Maybe you could trymod_wsgi. It is much more flexible.

On Windows, unlikely that mod_wsgi would make a difference as it only
provides embedded mode on Windows and so behaviour not much different
to mod_python.

> See "Time to deprecate mod_python":
>
> http://groups.google.com/group/modwsgi/browse_thread/thread/95c5de2b9...

Hmmm, I can see the subject line of that post coming back to haunt
me. :-(

I wasn't saying mod_python itself should be deprecated, but that the
hacks in mod_wsgi to get it to work in same process as mod_python
should be dropped. This would've meant that they couldn't be used
together, but would free up mod_wsgi to manage better how Python is
used and eliminate some shortcomings it has with being forced to do
things the mod_python way to cooperate with it.

Graham

Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Ulf Kronman

Hi Thomas,

> Apache creates several threads (or worker processes) and after one
> request the thread/process gets killed. But the other are still alive and
> have the old code loaded.
>
> Maybe you could try mod_wsgi. It is much more flexible.

Thanks for the tip. It seems as this could be the cause of this
peculiar behaviour.

The funny thing is that I have never seen anything like this on my
(older) Mac OS X or Linux installations of Apache/mod_python.

I'll give mod_wsgi a try.

Thanks,
Ulf
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Thomas Guettler

Ulf Kronman schrieb:
> I'm using Django trunk and I have set the MaxRequestsPerChild 1
> directive in httpd.conf. I'm running on Windows XP (sp3?).
>   
Here a guess:

Apache creates several threads (or worker processes) and after one
request the thread/process gets killed. But the other are still alive and
have the old code loaded.

Maybe you could try mod_wsgi. It is much more flexible.

See "Time to deprecate mod_python":

http://groups.google.com/group/modwsgi/browse_thread/thread/95c5de2b996e2f49/fe4f823a391ad954

HTH,
  Thomas Güttler

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


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