[ZODB-Dev] ZODB Caching Questions

Martin Gfeller martin.gfeller@comit.ch
Fri, 22 Mar 2002 11:41:38 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0049_01C1D196.86FF9180
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_004A_01C1D196.86FF9180"


------=_NextPart_001_004A_01C1D196.86FF9180
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Dear ZODB experts,

last October, I sent some questions about ZODB caching, but never got
any answer. As it is still important to us, and I've noticed some recent
traffic and work in this area, especially from Toby Dickenson,
I'd like to ask you again: 

We're using a number of ZODB databases to store financial deal objects 
and assorted static data objects. 

A reference to each object in a database is kept in a 'root' object,
which is a PersistentMapping.

1. If objects are referenced from a root object, they can never
   be deallocated (just deactivated), because at least one 
   reference is always kept. Is this so, and what are alternative 
   ways to do it?

2. If an object is a simple Python object, instead of being derived
   from Persistent, cache control never seems to touch it.
   Is this correct?

3. The cache statistics cache_mean_deal and cache_mean_deac never
   seem to show anything else than 0.0, despite tracing shows that 
   deactiviations occur.

4. If we have PersistentMappings of up to 100'000 entries, indexed
   by a (string,string) tuple, should we use a Btree instead?

Any hints appreciated. Thanks and best regards,

Martin Gfeller, mailto:martin.gfeller@comit.ch,  +41 1 298 9284
COMIT Gruppe, http://www.comit.ch
Risk Advice Services, http://www.quantax.com
>Quantax Professional - Downsized Trading and Risk System<


------=_NextPart_001_004A_01C1D196.86FF9180
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4630.0">
<TITLE>ZODB Caching Questions</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Courier New">Dear ZODB experts,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">last October, I sent some =
questions about ZODB caching, but never got</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">any answer. As it is still =
important to us, and I've noticed some recent</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">traffic and work in this area, =
especially from Toby Dickenson,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">I'd like to ask you again: =
</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">We're using a number of ZODB =
databases to store financial deal objects </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">and assorted static data =
objects. </FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">A reference to each object in a =
database is kept in a 'root' object,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">which is a =
PersistentMapping.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">1. If objects are referenced from =
a root object, they can never</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; be deallocated =
(just deactivated), because at least one </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; reference is always =
kept. Is this so, and what are alternative </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; ways to do =
it?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">2. If an object is a simple =
Python object, instead of being derived</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; from Persistent, =
cache control never seems to touch it.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; Is this =
correct?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">3. The cache statistics =
cache_mean_deal and cache_mean_deac never</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; seem to show =
anything else than 0.0, despite tracing shows that </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; deactiviations =
occur.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">4. If we have PersistentMappings =
of up to 100'000 entries, indexed</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&nbsp;&nbsp; by a =
(string,string) tuple, should we use a Btree instead?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">Any hints appreciated. Thanks and =
best regards,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">Martin Gfeller, </FONT><A =
HREF=3D"mailto:martin.gfeller@comit.ch"><U><FONT COLOR=3D"#0000FF" =
SIZE=3D2 FACE=3D"Courier =
New">mailto:martin.gfeller@comit.ch</FONT></U></A><FONT SIZE=3D2 =
FACE=3D"Courier New">,&nbsp; +41 1 298 9284</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">COMIT Gruppe, </FONT><A =
HREF=3D"http://www.comit.ch"><U><FONT COLOR=3D"#0000FF" SIZE=3D2 =
FACE=3D"Courier New">http://www.comit.ch</FONT></U></A>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">Risk Advice Services, </FONT><A =
HREF=3D"http://www.quantax.com"><U><FONT COLOR=3D"#0000FF" SIZE=3D2 =
FACE=3D"Courier New">http://www.quantax.com</FONT></U></A>

<BR><FONT SIZE=3D2 FACE=3D"Courier New">&gt;Quantax Professional - =
Downsized Trading and Risk System&lt;</FONT>
</P>

</BODY>
</HTML>
------=_NextPart_001_004A_01C1D196.86FF9180--

------=_NextPart_000_0049_01C1D196.86FF9180
Content-Type: text/x-vcard;
	name="Martin Gfeller.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="Martin Gfeller.vcf"

BEGIN:VCARD
VERSION:2.1
N:Gfeller;Martin
FN:Martin Gfeller
ORG:;Comit Schweiz
TEL;WORK;VOICE:+41 1 298 92 84
TEL;HOME;VOICE:+41 1 271 94 07
TEL;CELL;VOICE:+41 79 400 21 43
EMAIL;PREF;INTERNET:martin.gfeller@comit.ch
REV:20020218T160255Z
END:VCARD

------=_NextPart_000_0049_01C1D196.86FF9180--