[ZODB-Dev] Server-side caching
Jim Fulton
jim at zope.com
Fri Feb 10 11:42:11 UTC 2012
On Fri, Feb 10, 2012 at 4:49 AM, Pedro Ferreira
<jose.pedro.ferreira at cern.ch> wrote:
> Hello all,
>
> A (possibly silly) question: does ZEO have some kind of server-side cache? I
> mean, each time an oid is requested by one of the clients is it retrieved
> from the DB file directly, or are some of the objects kept in memory? From
> what I see in the code, the latter doesn't seem to happen.
No -- and yes. :)
The OS' file-system cache acts as a storage server cache. The storage
server does (essentially) no processing to data read from disk, so an
application-level cache would add nothing over the disk cache provided by
the storage server.
Also note that, for better or worse, FileStorage uses an in-memory index
of current record positions, so no disk access is needed to find current data.
> I know there are client-side caches, but in a multiple client/server context
> I wonder if it's not faster to ask the DB for an oid that is already in
> memory instead of retrieving it from the client cache?
In general, I'd say no. It can depend on lots of details, including:
- database size
- active set size
- network speed
- memory and disk speeds on clients and servers
- ...
Jim
--
Jim Fulton
http://www.linkedin.com/in/jimfulton
More information about the ZODB-Dev
mailing list