[Zope] server stopping

Jim Fulton jim@digicool.com
Thu, 02 Dec 1999 16:47:44 +0000


Doug Hellmann wrote:
> 
> We had set our thread count to 200 (excessively large, but we were
> trying to figure out if having a high thread count would help) and saw
> no difference.  The hardwired limit on the ZODB explains that.
> 
> Is there any way to change the limit? 

Sure, you can edit lib/python/ZODB/DB.py, :)
at least for experimentation purposes. There isn't
a knob for this now ....OK I just a crude one in.

Zope looks for a module named "custom_zodb" in your
instance home (usually the root of your Zope distribution).
If it finds it, it tries to get the attribute 'Storage'
from it. This allows you to use an alternate storage.

I just checked in a change (to lib/python/Zope/__init__.py) 
that lets you define an attribute 'DB', which is an actual 
database instance.  This allows you
to set parameters for which there aren't higher-level controls.
For example, to set the maximum number of (non-version) database 
connections to 20, create a custom_zodb.py file with:

  
import Globals, ZODB, ZODB.FileStorage

DB=ZODB.FileStorage.FileStorage(Globals.BobobaseName)
DB=ZODB.DB(DB)
DB._pool_size=20


> Is that a Bad Thing to do? 

No.

> Is there something magic about the number 7?

No. Keep in mind that there is some overhead on connections:

  - Zope has to do some computation on connections to manage 
    their caches.  If there were a large number of conections, 
    the overhead of this could, eventually, become costly.
    The cache management logic is mostly written in C, so
    this might not be very important.

  - Each database connection has it's own object cache.  If you 
    had a large number of very active connections, the memory 
    footprint would be bigger than with a smaller number 
    of connections. OTOH, caches of inactive connections tend 
    to shrink over time.

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.