]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-bdb.5
b02e5eac0ad99dda02584c1a41b9a2380fca5ae8
[openldap] / doc / man / man5 / slapd-bdb.5
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.
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 is the recommended primary backend for a normal 
13 .B slapd 
14 database.
15 It uses the Oracle Berkeley DB (BDB) package to store data.
16 It makes extensive use of indexing and caching to speed data access.
17 .LP
18 \fBhdb\fP is a variant of the \fBbdb\fP backend that uses a 
19 hierarchical database
20 layout which supports subtree renames. It is otherwise identical to
21 the \fBbdb\fP behavior, and all the same configuration options apply.
22 .LP
23 It is noted that these options are intended to complement
24 Berkeley DB configuration options set in the environment's
25 .B DB_CONFIG
26 file.  See Berkeley DB documentation for details on
27 .B DB_CONFIG
28 configuration options.
29 Where there is overlap, settings in
30 .B DB_CONFIG
31 take precedence.
32 .SH CONFIGURATION
33 These
34 .B slapd.conf
35 options apply to the \fBbdb\fP and \fBhdb\fP backend database.
36 That is, they must follow a "database bdb" or "database hdb" line and
37 come before any subsequent "backend" or "database" lines.
38 Other database options are described in the
39 .BR slapd.conf (5)
40 manual page.
41 .TP
42 .BI cachesize \ <integer>
43 Specify the size in entries of the in-memory entry cache maintained 
44 by the \fBbdb\fP or \fBhdb\fP backend database instance.
45 The default is 1000 entries.
46 .TP
47 .BI cachefree \ <integer>
48 Specify the number of entries to free from the entry cache when the
49 cache reaches the \fBcachesize\fP limit.
50 The default is 1 entry.
51 .TP
52 .BI checkpoint \ <kbyte>\ <min>
53 Specify the frequency for checkpointing the database transaction log.
54 A checkpoint operation flushes the database buffers to disk and writes
55 a checkpoint record in the log.
56 The checkpoint will occur if either \fI<kbyte>\fP data has been written or
57 \fI<min>\fP minutes have passed since the last checkpoint.
58 Both arguments default to zero, in which case they are ignored. When
59 the \fI<min>\fP argument is non-zero, an internal task will run every 
60 \fI<min>\fP minutes to perform the checkpoint.
61 See the Berkeley DB reference guide for more details.
62 .TP
63 .B checksum
64 Enable checksum validation of DB pages whenever they are read from disk.
65 This setting can only be configured before any database files are created.
66 .TP
67 .BI cryptfile \ <file>
68 Specify the pathname of a file containing an encryption key to use for
69 encrypting the database. Encryption is performed using Berkeley DB's
70 implementation of AES. Note that encryption can only be configured before
71 any database files are created, and changing the key can only be done
72 after destroying the current database and recreating it. Encryption is
73 not enabled by default, and some distributions of Berkeley DB do not
74 support encryption.
75 .TP
76 .BI cryptkey \ <key>
77 Specify an encryption key to use for encrypting the database. This option
78 may be used when a separate
79 .I cryptfile
80 is not desired. Only one of
81 .B cryptkey
82 or
83 .B cryptfile
84 may be configured.
85 .TP
86 .BI dbconfig \ <Berkeley-DB-setting>
87 Specify a configuration directive to be placed in the
88 .B DB_CONFIG
89 file of the database directory. The
90 .B dbconfig
91 directive is just a convenience
92 to allow all necessary configuration to be set in the
93 .B slapd.conf
94 file.
95 The options set using this directive will only be written to the 
96 .B DB_CONFIG
97 file if no such file existed at server startup time, otherwise
98 they are completely ignored. This allows one
99 to set initial values without overwriting/destroying a 
100 .B DB_CONFIG 
101 file that was already customized through other means. 
102 This directive may be specified multiple times, as needed. 
103 For example:
104 .RS
105 .nf
106         dbconfig set_cachesize 0 1048576 0
107         dbconfig set_lg_bsize 2097152
108 .fi
109 .RE
110 .TP
111 .B dbnosync
112 Specify that on-disk database contents should not be immediately
113 synchronized with in memory changes.
114 Enabling this option may improve performance at the expense of data
115 security.
116 See the Berkeley DB reference guide for more details.
117 .TP
118 \fBdbpagesize \fR \fI<dbfile> <size>\fR
119 Specify the page size to use for a particular database file, in units
120 of 1024 bytes. The default for the
121 .B id2entry
122 file is 16, the default for all other files depends on the size of the
123 underlying filesystem's block size (typically 4 or 8).
124 The maximum that BerkeleyDB supports is 64. This
125 setting usually should not need to be changed, but if BerkeleyDB's
126 "db_stat \-d" shows a large amount of overflow pages in use in a file,
127 setting a larger size may increase performance at the expense of
128 data integrity. This setting only takes effect when a database is
129 being newly created. See the Berkeley DB reference guide for more details.
130 .TP
131 .BI directory \ <directory>
132 Specify the directory where the BDB files containing this database and
133 associated indexes live.
134 A separate directory must be specified for each database.
135 The default is
136 .BR LOCALSTATEDIR/openldap\-data .
137 .TP
138 .B dirtyread
139 Allow reads of modified but not yet committed data.
140 Usually transactions are isolated to prevent other operations from
141 accessing uncommitted data.
142 This option may improve performance, but may also return inconsistent
143 results if the data comes from a transaction that is later aborted.
144 In this case, the modified data is discarded and a subsequent search
145 will return a different result.
146 .TP
147 .BI dncachesize \ <integer>
148 Specify the maximum number of DNs in the in-memory DN cache.
149 Ideally this cache should be
150 large enough to contain the DNs of every entry in the database. If
151 set to a smaller value than the \fBcachesize\fP it will be silently
152 increased to equal the \fBcachesize\fP. The default value is 0 which
153 means unlimited, i.e. the DN cache will grow without bound.
154
155 It should be noted that the \fBDN cache\fP is allowed to temporarily
156 grow beyond the configured size. It does this if many entries are 
157 locked when it tries to do a purge, because that means they're
158 legitimately in use. Also, the \fBDN cache\fP never purges entries
159 that have cached children, so depending on the shape of the DIT, it 
160 could have lots of cached DNs over the defined limit.
161 .TP
162 .BI idlcachesize \ <integer>
163 Specify the size of the in-memory index cache, in index slots. The
164 default is zero. A larger value will speed up frequent searches of
165 indexed entries. An \fBhdb\fP database needs a large \fBidlcachesize\fP
166 for good search performance, typically three times the 
167 .B cachesize
168 (entry cache size)
169 or larger.
170 .TP
171 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
172 Specify the indexes to maintain for the given attribute (or
173 list of attributes).
174 Some attributes only support a subset of indexes.
175 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
176 are maintained.
177 Note that setting a default does not imply that all attributes will be
178 indexed. Also, for best performance, an
179 .B eq
180 index should always be configured for the
181 .B objectClass
182 attribute.
183
184 A number of special index parameters may be specified.
185 The index type
186 .B sub
187 can be decomposed into
188 .BR subinitial ,
189 .BR subany ,\ and
190 .B subfinal
191 indices.
192 The special type
193 .B nolang
194 may be specified to disallow use of this index by language subtypes.
195 The special type
196 .B nosubtypes
197 may be specified to disallow use of this index by named subtypes.
198 Note: changing \fBindex\fP settings in 
199 .BR slapd.conf (5)
200 requires rebuilding indices, see
201 .BR slapindex (8);
202 changing \fBindex\fP settings
203 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
204 of the indices online in a background task.
205 .TP
206 .B linearindex
207 Tell 
208 .B slapindex 
209 to index one attribute at a time. By default, all indexed
210 attributes in an entry are processed at the same time. With this option,
211 each indexed attribute is processed individually, using multiple passes
212 through the entire database. This option improves 
213 .B slapindex 
214 performance
215 when the database size exceeds the \fBdbcache\fP size. When the \fBdbcache\fP is
216 large enough, this option is not needed and will decrease performance.
217 Also by default, 
218 .B slapadd 
219 performs full indexing and so a separate 
220 .B slapindex
221 run is not needed. With this option, 
222 .B slapadd 
223 does no indexing and 
224 .B slapindex
225 must be used.
226 .TP
227 .BR lockdetect \ { oldest | youngest | fewest | random | default }
228 Specify which transaction to abort when a deadlock is detected.
229 The default is
230 .BR random .
231 .TP
232 .BI mode \ <integer>
233 Specify the file protection mode that newly created database 
234 index files should have.
235 The default is 0600.
236 .TP
237 .BI searchstack \ <depth>
238 Specify the depth of the stack used for search filter evaluation.
239 Search filters are evaluated on a stack to accommodate nested AND / OR
240 clauses. An individual stack is assigned to each server thread.
241 The depth of the stack determines how complex a filter can be
242 evaluated without requiring any additional memory allocation. Filters that
243 are nested deeper than the search stack depth will cause a separate
244 stack to be allocated for that particular search operation. These
245 allocations can have a major negative impact on server performance,
246 but specifying too much stack will also consume a great deal of memory.
247 Each search stack uses 512K bytes per level. The default stack depth
248 is 16, thus 8MB per thread is used.
249 .TP
250 .BI shm_key \ <integer>
251 Specify a key for a shared memory BDB environment. By default the
252 BDB environment uses memory mapped files. If a non-zero value is
253 specified, it will be used as the key to identify a shared memory
254 region that will house the environment.
255 .SH ACCESS CONTROL
256 The 
257 .B bdb
258 and
259 .B hdb
260 backends honor access control semantics as indicated in
261 .BR slapd.access (5).
262 .SH FILES
263 .TP
264 .B ETCDIR/slapd.conf
265 default 
266 .B slapd 
267 configuration file
268 .TP
269 .B DB_CONFIG
270 Berkeley DB configuration file
271 .SH SEE ALSO
272 .BR slapd.conf (5),
273 .BR slapd\-config (5),
274 .BR slapd (8),
275 .BR slapadd (8),
276 .BR slapcat (8),
277 .BR slapindex (8),
278 Berkeley DB documentation.
279 .SH ACKNOWLEDGEMENTS
280 .so ../Project
281 Originally begun by Kurt Zeilenga. Caching mechanisms originally designed
282 by Jong-Hyuk Choi. Completion and subsequent work, as well as
283 back-hdb, by Howard Chu.