[ZODB-Dev] BerkeleyDB and copyTransactionsFrom()

Barry A. Warsaw barry@zope.com
Mon, 17 Sep 2001 16:19:27 -0400


>>>>> "AS" == Andrew Sydelko <sydelko@csociety.purdue.edu> writes:

    AS> To someone who understands BerkeleyDB, the error probably
    AS> makes lots of sense. But I'm not sure what is running
    AS> out of space / locks and what exactly should be done
    AS> to increase the amount of space / locks.

This is caused by Berkeley's default lock allocations, which I suspect
are going to be too low for most BDB Storage applications.  You'll
need to crank them up, but unfortunately there doesn't seem to be an
easy calculation to determine how large they need to be.

Up until recently, PyBSDDB3 didn't have quite the API to deal with
this programmatically, but I think the next version will.  For now,
the easiest approach is to set an environment variable DB_CONFIG which
points to a file.  In this file, put the following line:

set_lk_max 200000

I'm pretty sure 200k locks will be big enough for most applications.
If you find you're starving other resources (like running out of
memory), you may have to set this number lower.  Finding the exact
right number is a bit of a black art unfortunately.

I hope that helps,
-Barry