]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-bdb.5
Happy New Year
[openldap] / doc / man / man5 / slapd-bdb.5
1 .TH SLAPD-BDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2018 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd\-bdb, slapd\-hdb \- Berkeley DB backends to slapd
7 .SH SYNOPSIS
8 .B ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The \fBbdb\fP backend to
11 .BR slapd (8)
12 uses the Oracle Berkeley DB (BDB) package to store data.
13 It makes extensive use of indexing and caching to speed data access.
14 .LP
15 Note that BDB is deprecated and support will be dropped in future
16 OpenLDAP releases. Installations should use the \fBmdb\fP
17 backend instead.
18 .LP
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.
24 .LP
25 It is noted that these options are intended to complement
26 Berkeley DB configuration options set in the environment's
27 .B DB_CONFIG
28 file.  See Berkeley DB documentation for details on
29 .B DB_CONFIG
30 configuration options.
31 Where there is overlap, settings in
32 .B DB_CONFIG
33 take precedence.
34 .SH CONFIGURATION
35 These
36 .B slapd.conf
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
41 .BR slapd.conf (5)
42 manual page.
43 .TP
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.
48 .TP
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.
53 .TP
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.
64 .TP
65 .B checksum
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.
68 .TP
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
76 support encryption.
77 .TP
78 .BI cryptkey \ <key>
79 Specify an encryption key to use for encrypting the database. This option
80 may be used when a separate
81 .I cryptfile
82 is not desired. Only one of
83 .B cryptkey
84 or
85 .B cryptfile
86 may be configured.
87 .TP
88 .BI dbconfig \ <Berkeley-DB-setting>
89 Specify a configuration directive to be placed in the
90 .B DB_CONFIG
91 file of the database directory. The
92 .B dbconfig
93 directive is just a convenience
94 to allow all necessary configuration to be set in the
95 .B slapd.conf
96 file.
97 The options set using this directive will only be written to the 
98 .B DB_CONFIG
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 
102 .B DB_CONFIG 
103 file that was already customized through other means. 
104 This directive may be specified multiple times, as needed. 
105 For example:
106 .RS
107 .nf
108         dbconfig set_cachesize 0 1048576 0
109         dbconfig set_lg_bsize 2097152
110 .fi
111 .RE
112 .TP
113 .B dbnosync
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
117 security.
118 See the Berkeley DB reference guide for more details.
119 .TP
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
123 .B id2entry
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.
132 .TP
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.
137 The default is
138 .BR LOCALSTATEDIR/openldap\-data .
139 .TP
140 .B dirtyread
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.
148 .TP
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.
156
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.
163 .TP
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 
169 .B cachesize
170 (entry cache size)
171 or larger.
172 .TP
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
175 list of attributes).
176 Some attributes only support a subset of indexes.
177 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
178 are maintained.
179 Note that setting a default does not imply that all attributes will be
180 indexed. Also, for best performance, an
181 .B eq
182 index should always be configured for the
183 .B objectClass
184 attribute.
185
186 A number of special index parameters may be specified.
187 The index type
188 .B sub
189 can be decomposed into
190 .BR subinitial ,
191 .BR subany ,\ and
192 .B subfinal
193 indices.
194 The special type
195 .B nolang
196 may be specified to disallow use of this index by language subtypes.
197 The special type
198 .B nosubtypes
199 may be specified to disallow use of this index by named subtypes.
200 Note: changing \fBindex\fP settings in 
201 .BR slapd.conf (5)
202 requires rebuilding indices, see
203 .BR slapindex (8);
204 changing \fBindex\fP settings
205 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
206 of the indices online in a background task.
207 .TP
208 .B linearindex
209 Tell 
210 .B slapindex 
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 
215 .B slapindex 
216 performance
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.
219 Also by default, 
220 .B slapadd 
221 performs full indexing and so a separate 
222 .B slapindex
223 run is not needed. With this option, 
224 .B slapadd 
225 does no indexing and 
226 .B slapindex
227 must be used.
228 .TP
229 .BR lockdetect \ { oldest | youngest | fewest | random | default }
230 Specify which transaction to abort when a deadlock is detected.
231 The default is
232 .BR random .
233 .TP
234 .BI mode \ <integer>
235 Specify the file protection mode that newly created database 
236 index files should have.
237 The default is 0600.
238 .TP
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.
251 .TP
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.
257 .SH ACCESS CONTROL
258 The 
259 .B bdb
260 and
261 .B hdb
262 backends honor access control semantics as indicated in
263 .BR slapd.access (5).
264 .SH FILES
265 .TP
266 .B ETCDIR/slapd.conf
267 default 
268 .B slapd 
269 configuration file
270 .TP
271 .B DB_CONFIG
272 Berkeley DB configuration file
273 .SH SEE ALSO
274 .BR slapd.conf (5),
275 .BR slapd\-config (5),
276 .BR slapd\-mdb (5),
277 .BR slapd (8),
278 .BR slapadd (8),
279 .BR slapcat (8),
280 .BR slapindex (8),
281 Berkeley DB documentation.
282 .SH ACKNOWLEDGEMENTS
283 .so ../Project
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.