I've committed the dynamic session storage to CVS. The idea here is to
use both a memory store and a file store and move sessions between them
as required for access time and memory considerations.
This update also required moving the cleanStaleSessions function from
Application to Sessions.py. This shouldn't be a problem, and it
probably belongs in Session.py anyway.
Directions for configuring DynamicStore are in the file.
Note that this is a first pass. Currently, the logic centers around
keeping the memory store from exceeding a set size, so as not to kill a
machine. There is a setting for specifying the timeout interval at
which a session will be moved to the file store from the memory store,
but it currenlty is used as a starting point only. The system will
modify that timeout dynamically in deference to the maxNumber
configuration.
The way it works now, on the first run through, the system will move all
sessions which exceed the memoryTimeoutINterval to the file store. Then
it will chack to see if it has extra room in the memory store by looking
at the maxMemorySessions limit, which is the hard limit on the number of
sessions that can be in memory. If it finds extra room in the memory
store, it'll increase the memory timeout. Conversely, if it finds that
after doing a sweep there are still too many sessions in memory,
relative to the hard # limit, it will find a new memory timeout that
will get it below the max on the next sweep.
Anyway, have a look.
Also, at some point a while back, I changed the default backup storage
scheme for the memory store to match the file store. It used to keep
memory sessions in one big file. That would cause a problem if you
changed storage mechanisms. Now they use the same mechanism. I just
forgot to document that change.
Jay
|