[ZODB-Dev] ZEO 2 : cache twiddling

Guido van Rossum guido@python.org
Fri, 22 Nov 2002 07:17:11 -0500


> > > You probably only *need* a persistent cache if there is a slow
> > > network between your ZEO clients and servers.

[Chris]
> > Can you explain a little further? Then network between the clients
> > and servers is a LAN, so I wouldn't say it's slow,

[Toby]
> Thats fast enough that you dont *need* one.

Really?  I may be wrong, but that's not the impression I get from
operations at Zope Corp.  I'd expect that a local disk access is a lot
faster than having to roundtrip to a server, even on a fast LAN.  But
I've never measured this.  Have you?

I also think that without a cache, the extra load on the server might
do you in, especially if you have multiple clients all hitting the
same server.

> There are certainly some disadvantages to having one:
> * extra admin complexity (a little, anyway)
> * one more thing to go wrong.
> * the cache has to be validated at client startup. This causes:
>   * extra startup latency 
>   * a significant server load burst
> 
> Those last points could be eliminated if ZEO validated the cached
> objects when they were accessed, rather than eagerly at startup. I
> think there was a proposal to change this....

Jeremy & Jim have been talking about a way to speed up validation for
months, but I'm not sure what the current plan is.  It's definitely
something we want to address in the semi-near future.

> > but I'm curious as to why
> > the persistency of the cache is related to the network speed.
> 
> The cache can reduce the number of bytes sent over the network
> immediately after startup (until the volatile caches have been
> filled).

I think you misread the emphasis in Chris's question.  He's asking
about the difference in performance between a persistent ZEO cache and
a non-persistent one.

The persistence comes into play when the client goes down: after a
client restarts, it can either fault all objects into the cache
(non-persistent one), or keep the cache from before the crash
(persistent cache).  The persistent cache has a slower startup time
(due to validation), but the non-persistent cache causes the server to
be slow serving objects initially, until the cache has been warmed
up.  Which is better depends on a lot of variables; experiment!

--Guido van Rossum (home page: http://www.python.org/~guido/)