]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-bdb.5
further fulfilment of ITS#3639
[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 slapd-bdb, slapd-hdb \- Berkeley DB backends to slapd
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The BDB backend to
11 .BR slapd (8)
12 is the recommended backend for a normal slapd database.
13 However, it takes more care than with the LDBM backend to configure
14 it properly.
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 "hdb" is a variant of the BDB backend that uses a hierarchical database
19 layout which supports subtree renames. It is otherwise identical to
20 the "bdb" behavior, and all the same configuration options apply.
21 .LP
22 It is noted that these options are intended to complement
23 Berkeley DB configuration options set in the environment's
24 .B DB_CONFIG
25 file.  See Berkeley DB documentation for details on
26 .B DB_CONFIG
27 configuration options.
28 Where there is overlap, settings in
29 .B DB_CONFIG
30 take precedence.
31 .SH CONFIGURATION
32 These
33 .B slapd.conf
34 options apply to the BDB backend database.
35 That is, they must follow a "database bdb" or "database hdb" line and
36 come before any subsequent "backend" or "database" lines.
37 Other database options are described in the
38 .BR slapd.conf (5)
39 manual page.
40 .TP
41 .B cachesize <integer>
42 Specify the size in entries of the in-memory entry cache maintained 
43 by the BDB backend database instance.
44 The default is 1000 entries.
45 .TP
46 .B checkpoint <kbyte> <min>
47 Specify the frequency for checkpointing the database transaction log.
48 A checkpoint operation flushes the database buffers to disk and writes
49 a checkpoint record in the log.
50 The checkpoint will occur if either <kbyte> data has been written or
51 <min> minutes have passed since the last checkpoint.
52 Both arguments default to zero, in which case they are ignored. When
53 the <min> argument is non-zero, an internal task will run every <min>
54 minutes to perform the checkpoint.
55 See the Berkeley DB reference guide for more details.
56 .TP
57 .B dbconfig <Berkeley DB setting>
58 Specify a configuration directive to be placed in the
59 .B DB_CONFIG
60 file of the database directory. The
61 .B dbconfig
62 directive is just a convenience
63 to allow all necessary configuration to be set in the
64 .B slapd.conf
65 file.
66 The options set using this directive will only be written to the DB_CONFIG
67 file if no such file existed at server startup time. This allows one
68 to set initial values without overwriting/destroying a DB_CONFIG file
69 that was already customized through other means. This directive may
70 be specified multiple times, as needed. For example
71 .RS
72 .nf
73         dbconfig set_cachesize 0 1048576 0
74         dbconfig set_lg_bsize 2097152
75 .fi
76 .RE
77 .TP
78 .B dbnosync
79 Specify that on-disk database contents should not be immediately
80 synchronized with in memory changes.
81 Enabling this option may improve performance at the expense of data
82 security.
83 See the Berkeley DB reference guide for more details.
84 .TP
85 .B directory <directory>
86 Specify the directory where the BDB files containing this database and
87 associated indexes live.
88 A separate directory must be specified for each database.
89 The default is
90 .BR LOCALSTATEDIR/openldap-data .
91 .TP
92 .B dirtyread
93 Allow reads of modified but not yet committed data.
94 Usually transactions are isolated to prevent other operations from
95 accessing uncommitted data.
96 This option may improve performance, but may also return inconsistent
97 results if the data comes from a transaction that is later aborted.
98 In this case, the modified data is discarded and a subsequent search
99 will return a different result.
100 .TP
101 .B idlcachesize <integer>
102 Specify the size of the in-memory index cache, in index slots. The
103 default is zero. A larger value will speed up frequent searches of
104 indexed entries. An hdb database needs a large idlcachesize
105 for good search performance, typically three times the entry cache size
106 or larger.
107 .TP
108 .B
109 index {<attrlist>|default} [pres,eq,approx,sub,<special>]
110 Specify the indexes to maintain for the given attribute (or
111 list of attributes).
112 Some attributes only support a subset of indexes.
113 If only an <attr> is given, the indices specified for \fBdefault\fR
114 are maintained.
115 Note that setting a default does not imply that all attributes will be
116 indexed. Also, for best performance, an
117 .B eq
118 index should always be configured for the
119 .B objectClass
120 attribute.
121
122 A number of special index parameters may be specified.
123 The index type
124 .B sub
125 can be decomposed into
126 .BR subinitial ,
127 .BR subany ,\ and
128 .B subfinal
129 indices.
130 The special type
131 .B nolang
132 may be specified to disallow use of this index by language subtypes.
133 The special type
134 .B nosubtypes
135 may be specified to disallow use of this index by named subtypes.
136 Note: changing index settings requires rebuilding indices, see
137 .BR slapindex (8).
138 .TP
139 .B linearindex
140 Tell slapindex to index one attribute at a time. By default, all indexed
141 attributes in an entry are processed at the same time. With this option,
142 each indexed attribute is processed individually, using multiple passes
143 through the entire database. This option improves slapindex performance
144 when the database size exceeds the dbcache size. When the dbcache is
145 large enough, this option is not needed and will decrease performance.
146 Also by default, slapadd performs full indexing and so a separate slapindex
147 run is not needed. With this option, slapadd does no indexing and slapindex
148 must be used.
149 .TP
150 .B lockdetect {oldest|youngest|fewest|random|default}
151 Specify which transaction to abort when a deadlock is detected.
152 The default is the same as
153 .BR random .
154 .TP
155 .B mode <integer>
156 Specify the file protection mode that newly created database 
157 index files should have.
158 The default is 0600.
159 .TP
160 .B searchstack <depth>
161 Specify the depth of the stack used for search filter evaluation.
162 Search filters are evaluated on a stack to accommodate nested AND / OR
163 clauses. An individual stack is assigned to each server thread.
164 The depth of the stack determines how complex a filter can be
165 evaluated without requiring any additional memory allocation. Filters that
166 are nested deeper than the search stack depth will cause a separate
167 stack to be allocated for that particular search operation. These
168 allocations can have a major negative impact on server performance,
169 but specifying too much stack will also consume a great deal of memory.
170 Each search stack uses 512K bytes per level. The default stack depth
171 is 16, thus 8MB per thread is used.
172 .TP
173 .B shm_key <integer>
174 Specify a key for a shared memory BDB environment. By default the
175 BDB environment uses memory mapped files. If a non-zero value is
176 specified, it will be used as the key to identify a shared memory
177 region that will house the environment.
178 .B
179 .SH FILES
180 .TP
181 ETCDIR/slapd.conf
182 default slapd configuration file
183 .TP
184 DB_CONFIG
185 Berkeley DB configuration file
186 .SH SEE ALSO
187 .BR slapd.conf (5),
188 .BR slapd (8),
189 .BR slapadd (8),
190 .BR slapcat (8),
191 .BR slapindex (8),
192 Berkeley DB documentation.