(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) OpenLDAP Software FAQ : (Category) Configuration : (Category) SLAPD Configuration : (Category) Backends : (Category) The BDB/HDB backend (How do I setup/configure back-bdb/back-hdb?) : (Answer) What are the DB_CONFIG configuration directives?
The DB_CONFIG file

The Berkeley Database backend retrieves most of its configuration and tuning options from the DB_CONFIG file (see http://www.sleepycat.com/docs/ref/env/db_config.html for details). This file should be placed in the same directory as specified by the directory configuration option in the slapd.conf file.

The tuning values displayed here are for my own environment. Your environment will likely require different options. Using the Berkeley Database tools, in particular db_stat(1), is a good method for determining what values are proper for you system.

While this FAQ has some good information on setting the Berkeley Database tuning options, the best place to find tuning documentation is in the online documentation provide by Sleepycat Software.

        # Set the database in memory cache size.
        set_cachesize   0       52428800        0
        # Set database flags.
        # (for database loading/reindexing)               
        #set_flags       DB_TXN_NOSYNC
        # The above setting is not necessary in
        # OpenLDAP 2.3 and later.  Use the -q flag
        # to slapadd and slapindex instead.
        # Set log values.
        set_lg_regionmax        1048576
        set_lg_max              10485760
        set_lg_bsize            2097152
        set_lg_dir              /usr/local/var/openldap-logs
set_cachesize <gbytes> <bytes> <ncache>
Sets the database in memory cache size. See also (Xref) How do I determine the proper BDB/HDB database cache size?. Database entries and indexes will be stored in this cache to avoid disk access during database read and write operations. Tuning this value can greatly effect your database performance. The parameters are:
<gbytes>: The number of gigabytes of memory to allocate to the cache.
<bytes>: The number of bytes of memory to allocate to the cache.
<ncache>: The number of cache segments to use. If this value is set to 0 or 1 then Berkeley DB will try to allocate one contiguous section of memory for the cache. If this value is greater than 1, the cache will be split into that number of segments.

The current cache size is set by <gbytes> plus <bytes> and has a limit of 4 gigabytes total.

set_flags <flag>
Sets the database startup flags. There are various flag options that may be set. The DB_TXN_NOSYNC flag tells the database not to immediately flush transaction buffers to disk. Setting this flag can help speed up database access during periods of database write activity BUT at expense of data safety. Hence, setting it is not recommended (except maybe when using slapadd(8)). With OpenLDAP 2.3 and later, it is no longer necessary to specify DB_TXN_NOSYNC. Instead, use the -q flag to slapadd and slapindex.

set_lg_regionmax <bytes>
Set the maximum in memory cache in <bytes> for database file name caching. This value should be increased as the number of database files increases (tables and indexes).

set_lg_max <bytes>
Set the maximum size of log files in <bytes> . Logs will be rotated when <bytes> amount of data have been written to one log file. This value should be at least four times the size of set_lg_bsize.

set_lg_bsize <bytes>
Set the in memory cache for log information. When <bytes> amount of logging information have been written to this cache it will be flushed to disk.

set_lg_dir <directory>
Set the log file directory to <directory> . Log files should preferably be on a different disk than the database files.

[Append to This Answer]
trevorwarren@yahoo.com, Kurt@OpenLDAP.org, quanah@openldap.org, ghenry@suretecsystems.com
Previous: (Answer) How do I configure the BDB backend?
Next: (Answer) Why isn't all of this essential Sleepycat's BerkeleyDB documentation integrated directly into OpenLDAP's documentation?
This document is: http://www.openldap.org/faq/index.cgi?file=1072
[Search] [Appearance]
This is a Faq-O-Matic 2.721.test.
© Copyright 1998-2013, OpenLDAP Foundation, info@OpenLDAP.org