]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-mdb.5
Happy New Year!
[openldap] / doc / man / man5 / slapd-mdb.5
1 .TH SLAPD-MDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2011-2016 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 maxreaders \ <integer>
144 Specify the maximum number of threads that may have concurrent read access
145 to the database. Tools such as slapcat count as a single thread,
146 in addition to threads in any active slapd processes. The
147 default is 126.
148 .TP
149 .BI maxsize \ <bytes>
150 Specify the maximum size of the database in bytes. A memory map of this
151 size is allocated at startup time and the database will not be allowed
152 to grow beyond this size. The default is 10485760 bytes. This setting
153 may be changed upward if the configured limit needs to be increased.
154
155 Note: It is important to set this to as large a value as possible,
156 (relative to anticipated growth of the actual data over time) since
157 growing the size later may not be practical when the system is under
158 heavy load.
159 .TP
160 .BI mode \ <integer>
161 Specify the file protection mode that newly created database 
162 files should have.
163 The default is 0600.
164 .TP
165 .BI searchstack \ <depth>
166 Specify the depth of the stack used for search filter evaluation.
167 Search filters are evaluated on a stack to accommodate nested AND / OR
168 clauses. An individual stack is assigned to each server thread.
169 The depth of the stack determines how complex a filter can be
170 evaluated without requiring any additional memory allocation. Filters that
171 are nested deeper than the search stack depth will cause a separate
172 stack to be allocated for that particular search operation. These
173 allocations can have a major negative impact on server performance,
174 but specifying too much stack will also consume a great deal of memory.
175 Each search stack uses 512K bytes per level. The default stack depth
176 is 16, thus 8MB per thread is used.
177 .SH ACCESS CONTROL
178 The 
179 .B mdb
180 backend honors access control semantics as indicated in
181 .BR slapd.access (5).
182 .SH FILES
183 .TP
184 .B ETCDIR/slapd.conf
185 default 
186 .B slapd 
187 configuration file
188 .SH SEE ALSO
189 .BR slapd.conf (5),
190 .BR slapd\-config (5),
191 .BR slapd (8),
192 .BR slapadd (8),
193 .BR slapcat (8),
194 .BR slapindex (8),
195 OpenLDAP LMDB documentation.
196 .SH ACKNOWLEDGEMENTS
197 .so ../Project
198 Written by Howard Chu.