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