[ZODB-Dev] zeo client persistent cache files?

Chris McDonough chrism at plope.com
Sat Oct 30 19:15:28 EDT 2004


I'm currently writing an application that puts large "blobs" into ZODB.
To that end, I'm using the ZODB 3.2 release that is part of Zope 2.7.3.
Each blob is broken into many separate database records to conserve
client app RAM. Due to the nature of this application, I'm curious about
the purpose of persistent ZEO client cache files.

I had always assumed the intent of creating a persistent client cache
file was that if you shut down the program which acts as the ZEO client
and restarted it, that "less communication" would need to happen on the
next run of the client program between the client and the server.  The
cache file could be used to obtain object state as long as individual
object revisions in the cache matched those on the server.  As a result,
the only communications between the client and the server would be to
ensure that the cached data wasn't stale and that the actual data
needn't go over the wire.

But in some cursory tests, I find that this appears to not be the
case.  

If I start the ZEO client with a persistent cache file, and download a
set of objects from the database using the client (about 700 objects,
which, when reconstituted, make up a "file"), I get an aggregate
transfer speed from my app to a disk file of about 5MB/sec.  During this
request, I see a bunch of zeoLoad requests show up in the ZEO log.  A
subsequent request for the same set of objects in the same client
process lifetime gives me an aggregate transfer speed of about 70MB/s.
This is due to the data being returned from cache: the ZEO log file on
"debug" shows no ZEO loads during this request, so I know the data is
coming from cache under this circumstance.  This is good.

Then I shut down the client program and immediately restart it.  No
other processes are accessing the ZEO server, so no objects could have
changed on the server.  My first request for that same set of objects is
gives me an aggregate transfer rate of 5MB/s and the ZEO log file shows
lots of zeoLoad calls which appear to have the same general makeup as
the kinds of requests that would have come in if the data was not in in
the client cache.

I would have expected the actual transfer rate to be somewhat higher;
maybe not the "70MB/s" optimum that appears to be the limit of
cache-to-app transfer, but somewhere between that and the "worst case"
5MB/s of needing to load every object from the server again.

Am I misunderstanding the intent of persistent cache files?  Do I need
to shut down the client application in a certain way to ensure that the
cache files can be used on the next client application invocation?

FWIW, "client application" I refer to here is Zope 2.7.3.  Maybe it's
broken and doesn't shut itself down properly?

- C



More information about the ZODB-Dev mailing list