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