[Zope] Zope 2.7.0 and custom_zodb.py

John E. Barham john_e_barham at hotmail.com
Wed Jun 2 19:52:11 EDT 2004


Chris Withers wrote:

> John E. Barham wrote:
>
> > I'm running 2.7.0 on Linux (Mandrake) with Python 2.3.4.
> >
> > I wanted to bump up the database connection pool limit so put the
following
> > custom_zodb.py in the instance home:
>
> custom_zodb.py shouldn't be used in 2.7.0 AFAIK...

So I'd gathered from reading the changelog for 2.7.  However, Zope 2.7.0
still reads in the custom_zodb.py file if you create it but only complains
when you try to manage it through the ZMI.  IMHO it should either refuse to
load custom_zodb.py (and print some message giving the recommended
alternative) or else let you manage it from the ZMI.

> > import os
> > import ZODB.FileStorage
> > import ZODB.DB
> >
> > filename = os.path.join(INSTANCE_HOME, 'var', 'Data.fs')
> > Storage = ZODB.FileStorage.FileStorage(filename)
> > DB = ZODB.DB(Storage, pool_size=20, cache_size=2000)
>
> Look at zope.conf in the /etc directory of your instance. Check out the
ZODB
> section and see if there's a key that will do what you want.
>
> Also bear in mind that changing the pool size on it's own doesn't really
do
> much. You need to bump up the number of Zope threads running, otherwise
all you
> have is unused database connections lying about ;-)

To answer my own question, the Zope 2.7.0 way to increase the thread pool
size is to set the pool-size parameter of the <zodb_db main> in
etc/zope.conf like so:

<zodb_db main>
    # Main FileStorage database
    <filestorage>
      path $INSTANCE/var/Data.fs
    </filestorage>
    mount-point /
    pool-size 15
</zodb_db>

Bumping up the number of threads will also help as Chris says, but in my
case I mainly wanted to be able to increase the number of possible external
relational database connections (although they are distributed from general
database connection pool).

However, determining that this is the new way of increasing the database
connections pool took an inordinate amount of time searching through the
Zope source code and figuring out the new configuration system.  What's the
best way of documenting this so that other people don't have to go through
the same process?

    John



More information about the Zope mailing list