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