[mod_python] Session managment for mod_python

Gregory Trubetskoy grisha at modpython.org
Sun Oct 15 21:58:05 EST 2000


On Mon, 16 Oct 2000, Ben Leslie wrote:

> On Sun, 15 Oct 2000, Gregory Trubetskoy wrote:
> 
> > Let me guess - if Apache process is restarted, you would like the state to
> > be retained througout the restart?
> 
> I would count it as dynamic data that can be lost. I am thinking this thing
> would be great as a cache mainly for expensive database lookups, caching files
> into memory for faster loading.

The only example of dynamic data that can be lost that I can think of is
static, e.g. a list of zipcodes or a cached file, but that doesn't need to
be shared between apache processes - each process can have its own copy.

On the other hand database lookups are probably a lot cheaper than you
think. A simple retrival on a keyed table is not all that far from a
Python dictionary lookup, and most databases will do a great job at
caching queries in memory. The thing I don't like about databases is that
Python still lacks a consistent database API like perl's DBI, but that's a
different issue altogether...

There *are* some cases where shared memory is a must. In particular,
things relating to encryption where keys are exchanged at connection
initiation time. Apache 2.0 addresses those problems, I think there is not
a lot of sense in trying to solve this on 1.3.... I'd rather spend the
time porting mod_python to 2.0.

Grisha





More information about the Mod_python mailing list