[mod_python] Strange caching problem

Simon Willison cs1spw at bath.ac.uk
Wed Aug 27 23:19:00 EST 2003


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




More information about the Mod_python mailing list