[ZODB-Dev] ZEO 2

Guido van Rossum guido@python.org
Tue, 19 Nov 2002 11:06:17 -0500


> I've moved to ZEO 2 since a couple of issues have been marked as
> "won't fix" for ZEO 1:
> http://sourceforge.net/tracker/index.php?func=detail&aid=550087&group_id=15628&atid=115628
> http://sourceforge.net/tracker/index.php?func=detail&aid=634374&group_id=15628&atid=115628
> 
> However, the site in question now feels a bit slower than it used
> to.

Can you quantify that?  Are you sure the switch to ZEO 2 is *all* that
you changed?  (I agree that the ZEO 2 code is probably a tad slower
than ZEO 1 -- I'm just surprised that it would be measurable.)

> I also see things like the following in the logs of the client:
> 
> ------
> 2002-11-19T15:01:12 INFO(0) ZEC flipping cache files.  new current = 1
> ------
> 2002-11-19T15:01:40 INFO(0) ZEC flipping cache files.  new current = 0
> ------
> 2002-11-19T15:02:18 INFO(0) ZEC flipping cache files.  new current = 1
> ------
> 2002-11-19T15:02:44 INFO(0) ZEC flipping cache files.  new current = 0
> ------
> 2002-11-19T15:03:31 INFO(0) ZEC flipping cache files.  new current = 1
> ------
> 2002-11-19T15:04:23 INFO(0) ZEC flipping cache files.  new current = 0
> 
> What does this mean? Is it to be expected?

Yes, this is a form of cache instrumentation.  The cache is
implemented as two files.  The cache is managed as follows:

  - Data are written to file 0 until file 0 exceeds limit/2 in size.

  - Data are written to file 1 until file 1 exceeds limit/2 in size.

  - File 0 is truncated to size 0 (or deleted and recreated).

  - Data are written to file 0 until file 0 exceeds limit/2 in size.

  - File 1 is truncated to size 0 (or deleted and recreated).

  - Data are written to file 1 until file 1 exceeds limit/2 in size.

and so on.  The event where one of the files is truncated and made the
current cache file is called a "cache flip".

If you see cache flips every minute, you need a bigger ZEO cache.
Read the ZEO/README.txt file for hints on detailed cache
instrumentation.

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