]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-mdb.5
3949a4baee1d001fb61a831370e95bb0af9fd7c3
[openldap] / doc / man / man5 / slapd-mdb.5
1 .TH SLAPD-MDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2011-2018 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd\-mdb \- Memory-Mapped DB backend to slapd
7 .SH SYNOPSIS
8 .B ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The \fBmdb\fP backend to
11 .BR slapd (8)
12 uses OpenLDAP's Lightning Memory-Mapped DB (LMDB) library to store data.
13 It relies completely on the underlying operating system for memory
14 management and does no caching of its own. It is the recommended
15 primary database backend.
16 .LP
17 The \fBmdb\fP backend is similar to the \fBhdb\fP backend in that
18 it uses a hierarchical database layout which
19 supports subtree renames. It is both more space-efficient and more
20 execution-efficient than the \fBbdb\fP backend, while being overall
21 much simpler to manage.
22 .SH CONFIGURATION
23 These
24 .B slapd.conf
25 options apply to the \fBmdb\fP backend database.
26 That is, they must follow a "database mdb" line and
27 come before any subsequent "backend" or "database" lines.
28 Other database options are described in the
29 .BR slapd.conf (5)
30 manual page.
31 .TP
32 .BI checkpoint \ <kbyte>\ <min>
33 Specify the frequency for flushing the database disk buffers.
34 This setting is only needed if the \fBdbnosync\fP option is used.
35 The checkpoint will occur if either \fI<kbyte>\fP data has been written or
36 \fI<min>\fP minutes have passed since the last checkpoint.
37 Both arguments default to zero, in which case they are ignored. When
38 the \fI<min>\fP argument is non-zero, an internal task will run every 
39 \fI<min>\fP minutes to perform the checkpoint.
40 Note: currently the \fI<kbyte>\fP setting is unimplemented.
41 .TP
42 .B dbnosync
43 Specify that on-disk database contents should not be immediately
44 synchronized with in memory changes.
45 Enabling this option may improve performance at the expense of data
46 security. In particular, if the operating system crashes before changes are
47 flushed, some number of transactions may be lost.
48 By default, a full data flush/sync is performed when each
49 transaction is committed.
50 .TP
51 .BI directory \ <directory>
52 Specify the directory where the LMDB files containing this database and
53 associated indexes live.
54 A separate directory must be specified for each database.
55 The default is
56 .BR LOCALSTATEDIR/openldap\-data .
57 .TP
58 \fBenvflags \fR{\fBnosync\fR,\fBnometasync\fR,\fBwritemap\fR,\fBmapasync\fR,\fBnordahead\fR}
59 Specify flags for finer-grained control of the LMDB library's operation.
60 .RS
61 .TP
62 .B nosync
63 This is exactly the same as the
64 .I dbnosync
65 directive.
66 .RE
67 .RS
68 .TP
69 .B nometasync
70 Flush the data on a commit, but skip the sync of the meta page. This mode is
71 slightly faster than doing a full sync, but can potentially lose the last
72 committed transaction if the operating system crashes. If both
73 .I nometasync
74 and
75 .I nosync
76 are set, the
77 .I nosync
78 flag takes precedence.
79 .RE
80 .RS
81 .TP
82 .B writemap
83 Use a writable memory map instead of just read-only. This speeds up write operations
84 but makes the database vulnerable to corruption in case any bugs in slapd
85 cause stray writes into the mmap region.
86 .RE
87 .RS
88 .TP
89 .B mapasync
90 When using a writable memory map and performing flushes on each commit, use an
91 asynchronous flush instead of a synchronous flush (the default). This option
92 has no effect if
93 .I writemap
94 has not been set. It also has no effect if
95 .I nosync
96 is set.
97 .RE
98 .RS
99 .TP
100 .B nordahead
101 Turn off file readahead. Usually the OS performs readahead on every read
102 request. This usually boosts read performance but can be harmful to
103 random access read performance if the system's memory is full and the DB
104 is larger than RAM. This option is not implemented on Windows.
105 .RE
106
107 .TP
108 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
109 Specify the indexes to maintain for the given attribute (or
110 list of attributes).
111 Some attributes only support a subset of indexes.
112 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
113 are maintained.
114 Note that setting a default does not imply that all attributes will be
115 indexed. Also, for best performance, an
116 .B eq
117 index should always be configured for the
118 .B objectClass
119 attribute.
120
121 A number of special index parameters may be specified.
122 The index type
123 .B sub
124 can be decomposed into
125 .BR subinitial ,
126 .BR subany ,\ and
127 .B subfinal
128 indices.
129 The special type
130 .B nolang
131 may be specified to disallow use of this index by language subtypes.
132 The special type
133 .B nosubtypes
134 may be specified to disallow use of this index by named subtypes.
135 Note: changing \fBindex\fP settings in 
136 .BR slapd.conf (5)
137 requires rebuilding indices, see
138 .BR slapindex (8);
139 changing \fBindex\fP settings
140 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
141 of the indices online in a background task.
142 .TP
143 .BI maxentrysize \ <bytes>
144 Specify the maximum size of an entry in bytes. Attempts to store
145 an entry larger than this size will be rejected with the error
146 LDAP_ADMINLIMIT_EXCEEDED. The default is 0, which is unlimited.
147 .TP
148 .BI maxreaders \ <integer>
149 Specify the maximum number of threads that may have concurrent read access
150 to the database. Tools such as slapcat count as a single thread,
151 in addition to threads in any active slapd processes. The
152 default is 126.
153 .TP
154 .BI maxsize \ <bytes>
155 Specify the maximum size of the database in bytes. A memory map of this
156 size is allocated at startup time and the database will not be allowed
157 to grow beyond this size. The default is 10485760 bytes. This setting
158 may be changed upward if the configured limit needs to be increased.
159
160 Note: It is important to set this to as large a value as possible,
161 (relative to anticipated growth of the actual data over time) since
162 growing the size later may not be practical when the system is under
163 heavy load.
164 .TP
165 .BI mode \ <integer>
166 Specify the file protection mode that newly created database 
167 files should have.
168 The default is 0600.
169 .TP
170 .BI multival_hi \ <integer>
171 Specify the number of values above which a multivalued attribute is
172 stored in a separate table. Normally entries are stored as a single
173 blob inside the database. When an entry gets very large or contains
174 attributes with a very large number of values, modifications on that
175 entry may get very slow. Splitting the large attributes out to a separate
176 table can improve the performance of modification operations.
177 The default is UINT_MAX, which keeps all attributes in the main blob.
178 .TP
179 .BI multival_lo \ <integer>
180 Specify the number of values below which a multivalued attribute
181 that was stored in a separate table is moved back into the main
182 entry blob. If a modification deletes enough values to bring an
183 attribute below this threshold, its values will be removed from the
184 separate table and merged back into the main entry blob.
185 The default is UINT_MAX, which keeps all attributes in
186 the main blob.
187 .TP
188 .BI rtxnsize \ <entries>
189 Specify the maximum number of entries to process in a single read
190 transaction when executing a large search. Long-lived read transactions
191 prevent old database pages from being reused in write transactions, and
192 so can cause significant growth of the database file when there is
193 heavy write traffic. This setting causes the read transaction in
194 large searches to be released and reacquired after the given number
195 of entries has been read, to give writers the opportunity to
196 reclaim old database pages. The default is 10000.
197 .TP
198 .BI searchstack \ <depth>
199 Specify the depth of the stack used for search filter evaluation.
200 Search filters are evaluated on a stack to accommodate nested AND / OR
201 clauses. An individual stack is assigned to each server thread.
202 The depth of the stack determines how complex a filter can be
203 evaluated without requiring any additional memory allocation. Filters that
204 are nested deeper than the search stack depth will cause a separate
205 stack to be allocated for that particular search operation. These
206 allocations can have a major negative impact on server performance,
207 but specifying too much stack will also consume a great deal of memory.
208 Each search stack uses 512K bytes per level. The default stack depth
209 is 16, thus 8MB per thread is used.
210 .SH ACCESS CONTROL
211 The 
212 .B mdb
213 backend honors access control semantics as indicated in
214 .BR slapd.access (5).
215 .SH FILES
216 .TP
217 .B ETCDIR/slapd.conf
218 default 
219 .B slapd 
220 configuration file
221 .SH SEE ALSO
222 .BR slapd.conf (5),
223 .BR slapd\-config (5),
224 .BR slapd (8),
225 .BR slapadd (8),
226 .BR slapcat (8),
227 .BR slapindex (8),
228 OpenLDAP LMDB documentation.
229 .SH ACKNOWLEDGEMENTS
230 .so ../Project
231 Written by Howard Chu.