1 .TH SLAPD-BDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2014 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 slapd\-bdb, slapd\-hdb \- Berkeley DB backends to slapd
10 The \fBbdb\fP backend to
12 uses the Oracle Berkeley DB (BDB) package to store data.
13 It makes extensive use of indexing and caching to speed data access.
15 Note that BDB is deprecated and support will be dropped in future
16 OpenLDAP releases. Installations should use the \fBmdb\fP
19 \fBhdb\fP is a variant of
20 the \fBbdb\fP backend that uses a hierarchical database layout which
21 supports subtree renames. It is both more space-efficient and more
22 execution-efficient than the \fBbdb\fP backend. It is otherwise identical
23 to the \fBbdb\fP behavior, and all the same configuration options apply.
25 It is noted that these options are intended to complement
26 Berkeley DB configuration options set in the environment's
28 file. See Berkeley DB documentation for details on
30 configuration options.
31 Where there is overlap, settings in
37 options apply to the \fBbdb\fP and \fBhdb\fP backend database.
38 That is, they must follow a "database bdb" or "database hdb" line and
39 come before any subsequent "backend" or "database" lines.
40 Other database options are described in the
44 .BI cachesize \ <integer>
45 Specify the size in entries of the in-memory entry cache maintained
46 by the \fBbdb\fP or \fBhdb\fP backend database instance.
47 The default is 1000 entries.
49 .BI cachefree \ <integer>
50 Specify the number of entries to free from the entry cache when the
51 cache reaches the \fBcachesize\fP limit.
52 The default is 1 entry.
54 .BI checkpoint \ <kbyte>\ <min>
55 Specify the frequency for checkpointing the database transaction log.
56 A checkpoint operation flushes the database buffers to disk and writes
57 a checkpoint record in the log.
58 The checkpoint will occur if either \fI<kbyte>\fP data has been written or
59 \fI<min>\fP minutes have passed since the last checkpoint.
60 Both arguments default to zero, in which case they are ignored. When
61 the \fI<min>\fP argument is non-zero, an internal task will run every
62 \fI<min>\fP minutes to perform the checkpoint.
63 See the Berkeley DB reference guide for more details.
66 Enable checksum validation of DB pages whenever they are read from disk.
67 This setting can only be configured before any database files are created.
69 .BI cryptfile \ <file>
70 Specify the pathname of a file containing an encryption key to use for
71 encrypting the database. Encryption is performed using Berkeley DB's
72 implementation of AES. Note that encryption can only be configured before
73 any database files are created, and changing the key can only be done
74 after destroying the current database and recreating it. Encryption is
75 not enabled by default, and some distributions of Berkeley DB do not
79 Specify an encryption key to use for encrypting the database. This option
80 may be used when a separate
82 is not desired. Only one of
88 .BI dbconfig \ <Berkeley-DB-setting>
89 Specify a configuration directive to be placed in the
91 file of the database directory. The
93 directive is just a convenience
94 to allow all necessary configuration to be set in the
97 The options set using this directive will only be written to the
99 file if no such file existed at server startup time, otherwise
100 they are completely ignored. This allows one
101 to set initial values without overwriting/destroying a
103 file that was already customized through other means.
104 This directive may be specified multiple times, as needed.
108 dbconfig set_cachesize 0 1048576 0
109 dbconfig set_lg_bsize 2097152
114 Specify that on-disk database contents should not be immediately
115 synchronized with in memory changes.
116 Enabling this option may improve performance at the expense of data
118 See the Berkeley DB reference guide for more details.
120 \fBdbpagesize \fR \fI<dbfile> <size>\fR
121 Specify the page size to use for a particular database file, in units
122 of 1024 bytes. The default for the
124 file is 16, the default for all other files depends on the size of the
125 underlying filesystem's block size (typically 4 or 8).
126 The maximum that BerkeleyDB supports is 64. This
127 setting usually should not need to be changed, but if BerkeleyDB's
128 "db_stat \-d" shows a large amount of overflow pages in use in a file,
129 setting a larger size may increase performance at the expense of
130 data integrity. This setting only takes effect when a database is
131 being newly created. See the Berkeley DB reference guide for more details.
133 .BI directory \ <directory>
134 Specify the directory where the BDB files containing this database and
135 associated indexes live.
136 A separate directory must be specified for each database.
138 .BR LOCALSTATEDIR/openldap\-data .
141 Allow reads of modified but not yet committed data.
142 Usually transactions are isolated to prevent other operations from
143 accessing uncommitted data.
144 This option may improve performance, but may also return inconsistent
145 results if the data comes from a transaction that is later aborted.
146 In this case, the modified data is discarded and a subsequent search
147 will return a different result.
149 .BI dncachesize \ <integer>
150 Specify the maximum number of DNs in the in-memory DN cache.
151 Ideally this cache should be
152 large enough to contain the DNs of every entry in the database. If
153 set to a smaller value than the \fBcachesize\fP it will be silently
154 increased to equal the \fBcachesize\fP. The default value is 0 which
155 means unlimited, i.e. the DN cache will grow without bound.
157 It should be noted that the \fBDN cache\fP is allowed to temporarily
158 grow beyond the configured size. It does this if many entries are
159 locked when it tries to do a purge, because that means they're
160 legitimately in use. Also, the \fBDN cache\fP never purges entries
161 that have cached children, so depending on the shape of the DIT, it
162 could have lots of cached DNs over the defined limit.
164 .BI idlcachesize \ <integer>
165 Specify the size of the in-memory index cache, in index slots. The
166 default is zero. A larger value will speed up frequent searches of
167 indexed entries. An \fBhdb\fP database needs a large \fBidlcachesize\fP
168 for good search performance, typically three times the
173 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
174 Specify the indexes to maintain for the given attribute (or
176 Some attributes only support a subset of indexes.
177 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
179 Note that setting a default does not imply that all attributes will be
180 indexed. Also, for best performance, an
182 index should always be configured for the
186 A number of special index parameters may be specified.
189 can be decomposed into
196 may be specified to disallow use of this index by language subtypes.
199 may be specified to disallow use of this index by named subtypes.
200 Note: changing \fBindex\fP settings in
202 requires rebuilding indices, see
204 changing \fBindex\fP settings
205 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
206 of the indices online in a background task.
211 to index one attribute at a time. By default, all indexed
212 attributes in an entry are processed at the same time. With this option,
213 each indexed attribute is processed individually, using multiple passes
214 through the entire database. This option improves
217 when the database size exceeds the \fBdbcache\fP size. When the \fBdbcache\fP is
218 large enough, this option is not needed and will decrease performance.
221 performs full indexing and so a separate
223 run is not needed. With this option,
229 .BR lockdetect \ { oldest | youngest | fewest | random | default }
230 Specify which transaction to abort when a deadlock is detected.
235 Specify the file protection mode that newly created database
236 index files should have.
239 .BI searchstack \ <depth>
240 Specify the depth of the stack used for search filter evaluation.
241 Search filters are evaluated on a stack to accommodate nested AND / OR
242 clauses. An individual stack is assigned to each server thread.
243 The depth of the stack determines how complex a filter can be
244 evaluated without requiring any additional memory allocation. Filters that
245 are nested deeper than the search stack depth will cause a separate
246 stack to be allocated for that particular search operation. These
247 allocations can have a major negative impact on server performance,
248 but specifying too much stack will also consume a great deal of memory.
249 Each search stack uses 512K bytes per level. The default stack depth
250 is 16, thus 8MB per thread is used.
252 .BI shm_key \ <integer>
253 Specify a key for a shared memory BDB environment. By default the
254 BDB environment uses memory mapped files. If a non-zero value is
255 specified, it will be used as the key to identify a shared memory
256 region that will house the environment.
262 backends honor access control semantics as indicated in
263 .BR slapd.access (5).
272 Berkeley DB configuration file
275 .BR slapd\-config (5),
281 Berkeley DB documentation.
284 Originally begun by Kurt Zeilenga. Caching mechanisms originally designed
285 by Jong-Hyuk Choi. Completion and subsequent work, as well as
286 back-hdb, by Howard Chu.