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.
6 slapd\-mdb \- Memory-Mapped DB backend to slapd
10 The \fBmdb\fP backend to
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.
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.
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
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.
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.
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.
56 .BR LOCALSTATEDIR/openldap\-data .
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.
63 This is exactly the same as the
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
78 flag takes precedence.
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.
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
94 has not been set. It also has no effect if
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.
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
111 Some attributes only support a subset of indexes.
112 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
114 Note that setting a default does not imply that all attributes will be
115 indexed. Also, for best performance, an
117 index should always be configured for the
121 A number of special index parameters may be specified.
124 can be decomposed into
131 may be specified to disallow use of this index by language subtypes.
134 may be specified to disallow use of this index by named subtypes.
135 Note: changing \fBindex\fP settings in
137 requires rebuilding indices, see
139 changing \fBindex\fP settings
140 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
141 of the indices online in a background task.
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.
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
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.
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
166 Specify the file protection mode that newly created database
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.
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
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.
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.
213 backend honors access control semantics as indicated in
214 .BR slapd.access (5).
223 .BR slapd\-config (5),
228 OpenLDAP LMDB documentation.
231 Written by Howard Chu.