]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-bdb.5
Happy New Year (belated)
[openldap] / doc / man / man5 / slapd-bdb.5
1 .TH SLAPD-BDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2008 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 .BI cryptfile \ <file>
64 Specify the pathname of a file containing an encryption key to use for
65 encrypting the database. Encryption is performed using Berkeley DB's
66 implementation of AES. Note that encryption can only be configured before
67 any database files are created, and changing the key can only be done
68 after destroying the current database and recreating it. Encryption is
69 not enabled by default, and some distributions of Berkeley DB do not
70 support encryption.
71 .TP
72 .BI cryptkey \ <key>
73 Specify an encryption key to use for encrypting the database. This option
74 may be used when a separate
75 .I cryptfile
76 is not desired. Only one of
77 .B cryptkey
78 or
79 .B cryptfile
80 may be configured.
81 .TP
82 .BI dbconfig \ <Berkeley\-DB\-setting>
83 Specify a configuration directive to be placed in the
84 .B DB_CONFIG
85 file of the database directory. The
86 .B dbconfig
87 directive is just a convenience
88 to allow all necessary configuration to be set in the
89 .B slapd.conf
90 file.
91 The options set using this directive will only be written to the 
92 .B DB_CONFIG
93 file if no such file existed at server startup time, otherwise
94 they are completely ignored. This allows one
95 to set initial values without overwriting/destroying a 
96 .B DB_CONFIG 
97 file that was already customized through other means. 
98 This directive may be specified multiple times, as needed. 
99 For example:
100 .RS
101 .nf
102         dbconfig set_cachesize 0 1048576 0
103         dbconfig set_lg_bsize 2097152
104 .fi
105 .RE
106 .TP
107 .B dbnosync
108 Specify that on-disk database contents should not be immediately
109 synchronized with in memory changes.
110 Enabling this option may improve performance at the expense of data
111 security.
112 See the Berkeley DB reference guide for more details.
113 .TP
114 .BI directory \ <directory>
115 Specify the directory where the BDB files containing this database and
116 associated indexes live.
117 A separate directory must be specified for each database.
118 The default is
119 .BR LOCALSTATEDIR/openldap-data .
120 .TP
121 .B dirtyread
122 Allow reads of modified but not yet committed data.
123 Usually transactions are isolated to prevent other operations from
124 accessing uncommitted data.
125 This option may improve performance, but may also return inconsistent
126 results if the data comes from a transaction that is later aborted.
127 In this case, the modified data is discarded and a subsequent search
128 will return a different result.
129 .TP
130 .BI dncachesize \ <integer>
131 Specify the maximum number of DNs in the in-memory DN cache. The
132 default is twice the \fBcachesize\fP. Ideally this cache should be
133 large enough to contain the DNs of every entry in the database.
134 .TP
135 .BI idlcachesize \ <integer>
136 Specify the size of the in-memory index cache, in index slots. The
137 default is zero. A larger value will speed up frequent searches of
138 indexed entries. An \fBhdb\fP database needs a large \fBidlcachesize\fP
139 for good search performance, typically three times the 
140 .B cachesize
141 (entry cache size)
142 or larger.
143 .TP
144 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
145 Specify the indexes to maintain for the given attribute (or
146 list of attributes).
147 Some attributes only support a subset of indexes.
148 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
149 are maintained.
150 Note that setting a default does not imply that all attributes will be
151 indexed. Also, for best performance, an
152 .B eq
153 index should always be configured for the
154 .B objectClass
155 attribute.
156
157 A number of special index parameters may be specified.
158 The index type
159 .B sub
160 can be decomposed into
161 .BR subinitial ,
162 .BR subany ,\ and
163 .B subfinal
164 indices.
165 The special type
166 .B nolang
167 may be specified to disallow use of this index by language subtypes.
168 The special type
169 .B nosubtypes
170 may be specified to disallow use of this index by named subtypes.
171 Note: changing \fBindex\fP settings in 
172 .BR slapd.conf (5)
173 requires rebuilding indices, see
174 .BR slapindex (8);
175 changing \fBindex\fP settings
176 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
177 of the indices online in a background task.
178 .TP
179 .B linearindex
180 Tell 
181 .B slapindex 
182 to index one attribute at a time. By default, all indexed
183 attributes in an entry are processed at the same time. With this option,
184 each indexed attribute is processed individually, using multiple passes
185 through the entire database. This option improves 
186 .B slapindex 
187 performance
188 when the database size exceeds the \fBdbcache\fP size. When the \fBdbcache\fP is
189 large enough, this option is not needed and will decrease performance.
190 Also by default, 
191 .B slapadd 
192 performs full indexing and so a separate 
193 .B slapindex
194 run is not needed. With this option, 
195 .B slapadd 
196 does no indexing and 
197 .B slapindex
198 must be used.
199 .TP
200 .BR lockdetect \ { oldest | youngest | fewest | random | default }
201 Specify which transaction to abort when a deadlock is detected.
202 The default is
203 .BR random .
204 .TP
205 .BI mode \ <integer>
206 Specify the file protection mode that newly created database 
207 index files should have.
208 The default is 0600.
209 .TP
210 .BI searchstack \ <depth>
211 Specify the depth of the stack used for search filter evaluation.
212 Search filters are evaluated on a stack to accommodate nested AND / OR
213 clauses. An individual stack is assigned to each server thread.
214 The depth of the stack determines how complex a filter can be
215 evaluated without requiring any additional memory allocation. Filters that
216 are nested deeper than the search stack depth will cause a separate
217 stack to be allocated for that particular search operation. These
218 allocations can have a major negative impact on server performance,
219 but specifying too much stack will also consume a great deal of memory.
220 Each search stack uses 512K bytes per level. The default stack depth
221 is 16, thus 8MB per thread is used.
222 .TP
223 .BI shm_key \ <integer>
224 Specify a key for a shared memory BDB environment. By default the
225 BDB environment uses memory mapped files. If a non-zero value is
226 specified, it will be used as the key to identify a shared memory
227 region that will house the environment.
228 .SH ACCESS CONTROL
229 The 
230 .B bdb
231 and
232 .B hdb
233 backends honor access control semantics as indicated in
234 .BR slapd.access (5).
235 .SH FILES
236 .TP
237 .B ETCDIR/slapd.conf
238 default 
239 .B slapd 
240 configuration file
241 .TP
242 .B DB_CONFIG
243 Berkeley DB configuration file
244 .SH SEE ALSO
245 .BR slapd.conf (5),
246 .BR slapd (8),
247 .BR slapadd (8),
248 .BR slapcat (8),
249 .BR slapindex (8),
250 Berkeley DB documentation.
251 .SH ACKNOWLEDGEMENTS
252 .so ../Project
253 Originally begun by Kurt Zeilenga. Caching mechanisms originally designed
254 by Jong-Hyuk Choi. Completion and subsequent work, as well as
255 back-hdb, by Howard Chu.