[ZODB-Dev] Tuning the cache

Jeremy Hylton jeremy@zope.com (Jeremy Hylton)
Wed, 13 Nov 2002 11:27:49 -0500


>>>>> "NS" == Neil Schemenauer <nas@mems-exchange.org> writes:

  NS> We have a server that has lots of memory and our database is not
  NS> too large.  Does anyone have hints on tuning the ZODB cache
  NS> settings?  I see the methods setCacheDeactivateAfter(),
  NS> setCacheSize(), and setPoolSize() but there is not documentation
  NS> for them.

Make the cache size as big as possible without causing problems.  Or,
I don't have any experience tuning it, but my intuition is that bigger
is better.

The pool size is not what you're after (I think).  The pool size
refers to the connection pool.  When a connection is closed, it isn't
freed, it's put back in the pool.  A connection in the pool keeps all
its cached objects, with the hope that the next client to open a
connection will benefit from the warm cache.

I assuming you're asking about ZODB 3.1.  The cache size is more
meaningful for this version.  The cache size, which can be passed
as a keyword arg to the DB ctor and via setCacheSize(), specifies the
maximum number of non-ghost, non-modified objects that will be held in
the cache.  A bigger number means more objects will be held in the
cache, presumably giving you better performance.

The setCacheDeactivateAfter() has no effect in 3.1.

Jeremy