[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Implementing database tuning checks (2.1.29/db4.2.52.2/bdb)

On Thu, 20 May 2004, Micah Anderson wrote:

> I have tried to use this script, but when I do I get the following
> output:
> db_archive: Ignoring log file: /var/lib/ldap/log.0000000001:
> unsupported log version 7
> (I have a line for each one of the log files)

The Perl script in question uses db_archive -s to produce a list of
relevant database files in your $DB_HOME. You could try substituting
something like:

my @all_dbs = glob("*.bdb");

if you are certain that all of the *.bdb files in your $DB_HOME
are used for your LDAP database only.

Incidentally, you should consider storing your transaction logs
someplace other than your $DB_HOME (preferably on a separate disk).

> Minimum BDB cache size
> Date: Thu May 20 17:04:00 2004
> Hash dbs                             HBk Ovr Dup  PgSz    Cache
> Btrieve dbs                                  IPg  PgSz    Cache
> Minimum cache size:                                           0

This suggests to me that either the @all_dbs list was unpopulated
(perhaps due to the error, above) or that the db_stat command failed
for some other reason. You might try capturing stderr in the backticks
for the db_stat command and printing it to see what's happening. That

@stats = `$db_stat -d $db 2>&1`;
warn @stats;	# Debug

> This is on debian testing, I am trying to parse the FAQ's details, but
> it is quite difficult and would love a script that would aid in this.

I extracted two formulas from Howard's FAQ entry (sorry if these
word wrap in your mailer):

For each Btrieve organized db (for me, this is id2entry.bdb and
subtotal = (internal pages + 1) * page size

For each hash organized db:
subtotal = ((hash buckets + bucket overflow pages + dup pages) * page size)/2

I understand the sum of all of the above subtotals to be a
rough approximation of a minimum bdb cache size for OpenLDAP's
back-bdb. The Perl script just runs db_stat -d to gather the above
information for each bdb file then adds it all up and prints it out.

Kirk Turner-Rustin
Libraries and Information Services
Ohio Wesleyan University