[mod_python] Strange caching problem

David Fraser davidf at sjsoft.com
Thu Aug 28 07:40:55 EST 2003


Simon Willison wrote:

> john spurling wrote:
>
>>> If I load it up in a browser and continuously hit refresh, the 
>>> number only increments every 4 or 5 page loads. I was expecting it 
>>> to increment each time. Don't worry - this isn't how I intend to 
>>> implement a page counter, it's just an experiment I'm using to try 
>>> and gain a better understanding of this capability.
>>
>>
>> grep for "StartServers" in your httpd.conf. i'm guessing it's about 4
>> or 5. 
>
>
> The lights just came on. This has a pretty big impact on application 
> design. Presumably it means that the "shared memory" ability of 
> mod_python (where global variables in a module are accessible to 
> multiple requests) is only really useful as a performance enhancement 
> - data loaded from the filesystem or database that is unlikely to 
> change can be held in memory, but it's a bad idea to change that data 
> as it won't be there for all 4 or 5 Apache processes.
>
> Thanks again,
>
> Simon

mod_python 3.1alpha which is soon to be released has support for real 
shared memory that can be accessed by all the interpreters

David



More information about the Mod_python mailing list