1 .TH SLAPD-BDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2011 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 \fBhdb\fP is the recommended primary database backend. It is a variant of
16 the \fBbdb\fP backend that uses a hierarchical database layout which
17 supports subtree renames. It is both more space-efficient and more
18 execution-efficient than the \fBbdb\fP backend. It is otherwise identical
19 to the \fBbdb\fP behavior, and all the same configuration options apply.
21 It is noted that these options are intended to complement
22 Berkeley DB configuration options set in the environment's
24 file. See Berkeley DB documentation for details on
26 configuration options.
27 Where there is overlap, settings in
33 options apply to the \fBbdb\fP and \fBhdb\fP backend database.
34 That is, they must follow a "database bdb" or "database hdb" line and
35 come before any subsequent "backend" or "database" lines.
36 Other database options are described in the
40 .BI cachesize \ <integer>
41 Specify the size in entries of the in-memory entry cache maintained
42 by the \fBbdb\fP or \fBhdb\fP backend database instance.
43 The default is 1000 entries.
45 .BI cachefree \ <integer>
46 Specify the number of entries to free from the entry cache when the
47 cache reaches the \fBcachesize\fP limit.
48 The default is 1 entry.
50 .BI checkpoint \ <kbyte>\ <min>
51 Specify the frequency for checkpointing the database transaction log.
52 A checkpoint operation flushes the database buffers to disk and writes
53 a checkpoint record in the log.
54 The checkpoint will occur if either \fI<kbyte>\fP data has been written or
55 \fI<min>\fP minutes have passed since the last checkpoint.
56 Both arguments default to zero, in which case they are ignored. When
57 the \fI<min>\fP argument is non-zero, an internal task will run every
58 \fI<min>\fP minutes to perform the checkpoint.
59 See the Berkeley DB reference guide for more details.
62 Enable checksum validation of DB pages whenever they are read from disk.
63 This setting can only be configured before any database files are created.
65 .BI cryptfile \ <file>
66 Specify the pathname of a file containing an encryption key to use for
67 encrypting the database. Encryption is performed using Berkeley DB's
68 implementation of AES. Note that encryption can only be configured before
69 any database files are created, and changing the key can only be done
70 after destroying the current database and recreating it. Encryption is
71 not enabled by default, and some distributions of Berkeley DB do not
75 Specify an encryption key to use for encrypting the database. This option
76 may be used when a separate
78 is not desired. Only one of
84 .BI dbconfig \ <Berkeley-DB-setting>
85 Specify a configuration directive to be placed in the
87 file of the database directory. The
89 directive is just a convenience
90 to allow all necessary configuration to be set in the
93 The options set using this directive will only be written to the
95 file if no such file existed at server startup time, otherwise
96 they are completely ignored. This allows one
97 to set initial values without overwriting/destroying a
99 file that was already customized through other means.
100 This directive may be specified multiple times, as needed.
104 dbconfig set_cachesize 0 1048576 0
105 dbconfig set_lg_bsize 2097152
110 Specify that on-disk database contents should not be immediately
111 synchronized with in memory changes.
112 Enabling this option may improve performance at the expense of data
114 See the Berkeley DB reference guide for more details.
116 \fBdbpagesize \fR \fI<dbfile> <size>\fR
117 Specify the page size to use for a particular database file, in units
118 of 1024 bytes. The default for the
120 file is 16, the default for all other files depends on the size of the
121 underlying filesystem's block size (typically 4 or 8).
122 The maximum that BerkeleyDB supports is 64. This
123 setting usually should not need to be changed, but if BerkeleyDB's
124 "db_stat \-d" shows a large amount of overflow pages in use in a file,
125 setting a larger size may increase performance at the expense of
126 data integrity. This setting only takes effect when a database is
127 being newly created. See the Berkeley DB reference guide for more details.
129 .BI directory \ <directory>
130 Specify the directory where the BDB files containing this database and
131 associated indexes live.
132 A separate directory must be specified for each database.
134 .BR LOCALSTATEDIR/openldap\-data .
137 Allow reads of modified but not yet committed data.
138 Usually transactions are isolated to prevent other operations from
139 accessing uncommitted data.
140 This option may improve performance, but may also return inconsistent
141 results if the data comes from a transaction that is later aborted.
142 In this case, the modified data is discarded and a subsequent search
143 will return a different result.
145 .BI dncachesize \ <integer>
146 Specify the maximum number of DNs in the in-memory DN cache.
147 Ideally this cache should be
148 large enough to contain the DNs of every entry in the database. If
149 set to a smaller value than the \fBcachesize\fP it will be silently
150 increased to equal the \fBcachesize\fP. The default value is 0 which
151 means unlimited, i.e. the DN cache will grow without bound.
153 It should be noted that the \fBDN cache\fP is allowed to temporarily
154 grow beyond the configured size. It does this if many entries are
155 locked when it tries to do a purge, because that means they're
156 legitimately in use. Also, the \fBDN cache\fP never purges entries
157 that have cached children, so depending on the shape of the DIT, it
158 could have lots of cached DNs over the defined limit.
160 .BI idlcachesize \ <integer>
161 Specify the size of the in-memory index cache, in index slots. The
162 default is zero. A larger value will speed up frequent searches of
163 indexed entries. An \fBhdb\fP database needs a large \fBidlcachesize\fP
164 for good search performance, typically three times the
169 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
170 Specify the indexes to maintain for the given attribute (or
172 Some attributes only support a subset of indexes.
173 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
175 Note that setting a default does not imply that all attributes will be
176 indexed. Also, for best performance, an
178 index should always be configured for the
182 A number of special index parameters may be specified.
185 can be decomposed into
192 may be specified to disallow use of this index by language subtypes.
195 may be specified to disallow use of this index by named subtypes.
196 Note: changing \fBindex\fP settings in
198 requires rebuilding indices, see
200 changing \fBindex\fP settings
201 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
202 of the indices online in a background task.
207 to index one attribute at a time. By default, all indexed
208 attributes in an entry are processed at the same time. With this option,
209 each indexed attribute is processed individually, using multiple passes
210 through the entire database. This option improves
213 when the database size exceeds the \fBdbcache\fP size. When the \fBdbcache\fP is
214 large enough, this option is not needed and will decrease performance.
217 performs full indexing and so a separate
219 run is not needed. With this option,
225 .BR lockdetect \ { oldest | youngest | fewest | random | default }
226 Specify which transaction to abort when a deadlock is detected.
231 Specify the file protection mode that newly created database
232 index files should have.
235 .BI searchstack \ <depth>
236 Specify the depth of the stack used for search filter evaluation.
237 Search filters are evaluated on a stack to accommodate nested AND / OR
238 clauses. An individual stack is assigned to each server thread.
239 The depth of the stack determines how complex a filter can be
240 evaluated without requiring any additional memory allocation. Filters that
241 are nested deeper than the search stack depth will cause a separate
242 stack to be allocated for that particular search operation. These
243 allocations can have a major negative impact on server performance,
244 but specifying too much stack will also consume a great deal of memory.
245 Each search stack uses 512K bytes per level. The default stack depth
246 is 16, thus 8MB per thread is used.
248 .BI shm_key \ <integer>
249 Specify a key for a shared memory BDB environment. By default the
250 BDB environment uses memory mapped files. If a non-zero value is
251 specified, it will be used as the key to identify a shared memory
252 region that will house the environment.
258 backends honor access control semantics as indicated in
259 .BR slapd.access (5).
268 Berkeley DB configuration file
271 .BR slapd\-config (5),
276 Berkeley DB documentation.
279 Originally begun by Kurt Zeilenga. Caching mechanisms originally designed
280 by Jong-Hyuk Choi. Completion and subsequent work, as well as
281 back-hdb, by Howard Chu.