Module caching

Graham Dumpleton Graham.Dumpleton at gmail.com
Sat Apr 4 03:42:04 EDT 2009


On Apr 4, 10:41 am, Jon Clements <jon... at googlemail.com> wrote:
> On 3 Apr, 23:58, Aaron Scott <aaron.hildebra... at gmail.com> wrote:
>
> > > are you an experienced python programmer?
>
> > Yeah, I'd link to think I'm fairly experienced and not making any
> > stupid mistakes. That said, I'm fairly new to working with mod_python.
>
> > All I really want is to have mod_python stop caching variables. This
> > seems like it should be easy enough to do, but I can't for the life of
> > me find information on how to do it.
>
> > Aaron
>
> Umm... Well, mod_python works for long running processes that don't
> really store data, but return it on demand... so keeping module level
> variables around is going to be a gotcha.
>
> It's a kludge, but setting MaxRequestsPerChild to 1 in the Apache
> config basically forces a reload of everything for every request...
> that might be worth a go -- but it's nasty...

They may as well use CGI then. Personally I would never recommend
MaxRequestsPerChild be set to 1.

Anyway, this person also posted on mod_python list. One of the things
I highlighted there was that mod_python for some configurations is
multithreaded and as such they may not be properly protecting
variables if they are storing them at global scope. They haven't
responded to any comments about it on mod_python list. They were also
told to read:

  http://www.dscpl.com.au/wiki/ModPython/Articles/TheProcessInterpreterModel

Graham



More information about the Python-list mailing list